27#include "./base/base_uses.f90"
31 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'pair_potential_types'
127 REAL(kind=
dp),
DIMENSION(2:15) :: a = 0.0_dp
128 REAL(kind=
dp) :: rcore = 0.0_dp
129 REAL(kind=
dp) :: m = 0.0_dp
130 REAL(kind=
dp) :: b = 0.0_dp
135 REAL(kind=
dp) :: epsilon = 0.0_dp
136 REAL(kind=
dp) :: sigma6 = 0.0_dp
137 REAL(kind=
dp) :: sigma12 = 0.0_dp
142 REAL(kind=
dp) :: a = 0.0_dp
143 REAL(kind=
dp) :: b = 0.0_dp
144 REAL(kind=
dp) :: c = 0.0_dp
145 REAL(kind=
dp) :: d = 0.0_dp
150 REAL(kind=
dp) :: a = 0.0_dp
151 REAL(kind=
dp) :: b = 0.0_dp
152 REAL(kind=
dp) :: c = 0.0_dp
153 REAL(kind=
dp) :: d = 0.0_dp
154 REAL(kind=
dp),
DIMENSION(2) :: bd = 0.0_dp
155 END TYPE ftd_pot_type
158 TYPE williams_pot_type
159 REAL(kind=
dp) :: a = 0.0_dp
160 REAL(kind=
dp) :: b = 0.0_dp
161 REAL(kind=
dp) :: c = 0.0_dp
162 END TYPE williams_pot_type
165 TYPE goodwin_pot_type
166 REAL(kind=
dp) :: vr0 = 0.0_dp
167 REAL(kind=
dp) :: m = 0.0_dp, mc = 0.0_dp
168 REAL(kind=
dp) :: d = 0.0_dp, dc = 0.0_dp
169 END TYPE goodwin_pot_type
173 CHARACTER(LEN=default_path_length) :: eam_file_name =
""
174 INTEGER :: npoints = 0
175 REAL(kind=
dp) :: drar = 0.0_dp, drhoar = 0.0_dp, acutal = 0.0_dp
176 REAL(kind=
dp),
POINTER,
DIMENSION(:) :: rho => null(), phi => null(), frho => null(), rhoval => null(), rval => null()
177 REAL(kind=
dp),
POINTER,
DIMENSION(:) :: rhop => null(), phip => null(), frhop => null()
182 CHARACTER(LEN=default_path_length) :: ace_file_name =
'NULL'
183 INTEGER :: atom_ace_type = 0
189 CHARACTER(LEN=default_path_length) :: deepmd_file_name =
'NULL'
190 INTEGER :: atom_deepmd_type = 0
195 CHARACTER(LEN=default_path_length) :: pot_file_name =
'NULL', &
196 unit_length =
'NULL', unit_forces =
'NULL', &
198 CHARACTER(LEN=100),
DIMENSION(:),
ALLOCATABLE :: type_names_torch
199 REAL(kind=
dp),
DIMENSION(:, :),
ALLOCATABLE :: cutoff_matrix
200 INTEGER :: num_types = 0
201 REAL(kind=
dp) :: rcutsq = 0.0_dp, unit_length_val = 1.0_dp, &
202 unit_forces_val = 1.0_dp, unit_energy_val = 1.0_dp
203 LOGICAL :: mixed_precision = .false.
207 TYPE buck4ran_pot_type
208 REAL(kind=
dp) :: a = 0.0_dp
209 REAL(kind=
dp) :: b = 0.0_dp
210 REAL(kind=
dp) :: c = 0.0_dp
211 REAL(kind=
dp) :: r1 = 0.0_dp
212 REAL(kind=
dp) :: r2 = 0.0_dp
213 REAL(kind=
dp) :: r3 = 0.0_dp
214 INTEGER :: npoly1 = 0, npoly2 = 0
215 REAL(kind=
dp),
DIMENSION(0:10) :: poly1 = 0.0_dp
216 REAL(kind=
dp),
DIMENSION(0:10) :: poly2 = 0.0_dp
217 END TYPE buck4ran_pot_type
220 TYPE buckmorse_pot_type
221 REAL(kind=
dp) :: f0 = 0.0_dp
222 REAL(kind=
dp) :: a1 = 0.0_dp
223 REAL(kind=
dp) :: a2 = 0.0_dp
224 REAL(kind=
dp) :: b1 = 0.0_dp
225 REAL(kind=
dp) :: b2 = 0.0_dp
226 REAL(kind=
dp) :: c = 0.0_dp
227 REAL(kind=
dp) :: d = 0.0_dp
228 REAL(kind=
dp) :: r0 = 0.0_dp
229 REAL(kind=
dp) :: beta = 0.0_dp
230 END TYPE buckmorse_pot_type
235 CHARACTER(LEN=default_path_length) :: potential =
""
236 CHARACTER(LEN=default_string_length), &
237 POINTER,
DIMENSION(:) :: parameters => null(), units => null()
238 CHARACTER(LEN=default_string_length) :: variables =
""
239 REAL(kind=
dp),
DIMENSION(:),
POINTER :: values => null()
245 REAL(kind=
dp) :: a = 0.0_dp
246 REAL(kind=
dp) :: b = 0.0_dp
247 REAL(kind=
dp) :: lambda1 = 0.0_dp
248 REAL(kind=
dp) :: lambda2 = 0.0_dp
249 REAL(kind=
dp) :: alpha = 0.0_dp
250 REAL(kind=
dp) :: beta = 0.0_dp
251 REAL(kind=
dp) :: n = 0.0_dp
252 REAL(kind=
dp) :: c = 0.0_dp
253 REAL(kind=
dp) :: d = 0.0_dp
254 REAL(kind=
dp) :: h = 0.0_dp
255 REAL(kind=
dp) :: lambda3 = 0.0_dp
256 REAL(kind=
dp) :: bigr = 0.0_dp
257 REAL(kind=
dp) :: bigd = 0.0_dp
258 REAL(kind=
dp) :: rcutsq = 0.0_dp
263 REAL(kind=
dp) :: b = 0.0_dp
264 REAL(kind=
dp) :: d = 0.0_dp
265 REAL(kind=
dp) :: e = 0.0_dp
266 REAL(kind=
dp) :: f = 0.0_dp
267 REAL(kind=
dp) :: beta = 0.0_dp
268 REAL(kind=
dp) :: rcutsq = 0.0_dp
269 LOGICAL :: allow_oh_formation = .false.
270 LOGICAL :: allow_h3o_formation = .false.
271 LOGICAL :: allow_o_formation = .false.
276 CHARACTER(LEN=2) :: met1 =
""
277 CHARACTER(LEN=2) :: met2 =
""
278 REAL(kind=
dp) :: epsilon = 0.0_dp
279 REAL(kind=
dp) :: bxy = 0.0_dp
280 REAL(kind=
dp) :: bz = 0.0_dp
281 REAL(kind=
dp) :: r1 = 0.0_dp
282 REAL(kind=
dp) :: r2 = 0.0_dp
283 REAL(kind=
dp) :: a1 = 0.0_dp
284 REAL(kind=
dp) :: a2 = 0.0_dp
285 REAL(kind=
dp) :: a3 = 0.0_dp
286 REAL(kind=
dp) :: a4 = 0.0_dp
287 REAL(kind=
dp) :: a = 0.0_dp
288 REAL(kind=
dp) :: b = 0.0_dp
289 REAL(kind=
dp) :: c = 0.0_dp
290 REAL(kind=
dp),
POINTER,
DIMENSION(:) :: gcn => null()
291 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: n_vectors
292 REAL(kind=
dp) :: rcutsq = 0.0_dp
293 LOGICAL :: express = .false.
299 CHARACTER(LEN=2) :: met1 =
""
300 CHARACTER(LEN=2) :: met2 =
""
301 REAL(kind=
dp) :: epsilon1 = 0.0_dp
302 REAL(kind=
dp) :: epsilon2 = 0.0_dp
303 REAL(kind=
dp) :: epsilon3 = 0.0_dp
304 REAL(kind=
dp) :: bxy1 = 0.0_dp
305 REAL(kind=
dp) :: bxy2 = 0.0_dp
306 REAL(kind=
dp) :: bz1 = 0.0_dp
307 REAL(kind=
dp) :: bz2 = 0.0_dp
308 REAL(kind=
dp) :: r1 = 0.0_dp
309 REAL(kind=
dp) :: r2 = 0.0_dp
310 REAL(kind=
dp) :: a11 = 0.0_dp
311 REAL(kind=
dp) :: a12 = 0.0_dp
312 REAL(kind=
dp) :: a13 = 0.0_dp
313 REAL(kind=
dp) :: a21 = 0.0_dp
314 REAL(kind=
dp) :: a22 = 0.0_dp
315 REAL(kind=
dp) :: a23 = 0.0_dp
316 REAL(kind=
dp) :: a31 = 0.0_dp
317 REAL(kind=
dp) :: a32 = 0.0_dp
318 REAL(kind=
dp) :: a33 = 0.0_dp
319 REAL(kind=
dp) :: a41 = 0.0_dp
320 REAL(kind=
dp) :: a42 = 0.0_dp
321 REAL(kind=
dp) :: a43 = 0.0_dp
322 REAL(kind=
dp) :: ao1 = 0.0_dp
323 REAL(kind=
dp) :: ao2 = 0.0_dp
324 REAL(kind=
dp) :: bo1 = 0.0_dp
325 REAL(kind=
dp) :: bo2 = 0.0_dp
326 REAL(kind=
dp) :: c = 0.0_dp
327 REAL(kind=
dp) :: ah1 = 0.0_dp
328 REAL(kind=
dp) :: ah2 = 0.0_dp
329 REAL(kind=
dp) :: bh1 = 0.0_dp
330 REAL(kind=
dp) :: bh2 = 0.0_dp
331 REAL(kind=
dp),
POINTER,
DIMENSION(:) :: gcn => null()
332 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: n_vectors
333 REAL(kind=
dp) :: rcutsq = 0.0_dp
334 LOGICAL :: express = .false.
340 CHARACTER(LEN=default_path_length) :: tabpot_file_name =
""
341 INTEGER :: npoints = 0, index = 0
342 REAL(kind=
dp) :: dr = 0.0_dp, rcut = 0.0_dp
343 REAL(kind=
dp),
POINTER,
DIMENSION(:) :: r => null(), e => null(), f => null()
349 REAL(kind=
dp) :: rmin = 0.0_dp, rmax = 0.0_dp
351 TYPE(gp_pot_type),
POINTER :: gp => null()
352 TYPE(lj_pot_type),
POINTER :: lj => null()
354 TYPE(williams_pot_type),
POINTER :: willis => null()
355 TYPE(goodwin_pot_type),
POINTER :: goodwin => null()
360 TYPE(buck4ran_pot_type),
POINTER :: buck4r => null()
361 TYPE(buckmorse_pot_type),
POINTER :: buckmo => null()
366 TYPE(ftd_pot_type),
POINTER :: ftd => null()
368 END TYPE pot_set_type
372 REAL(kind=
dp) :: rcutsq = 0.0_dp
373 REAL(kind=
dp) :: e_fac = 0.0_dp
374 REAL(kind=
dp) :: e_fcc = 0.0_dp
375 REAL(kind=
dp) :: e_fcs = 0.0_dp
376 REAL(kind=
dp) :: e_fsc = 0.0_dp
377 REAL(kind=
dp) :: z1 = 0.0_dp
378 REAL(kind=
dp) :: z2 = 0.0_dp
379 REAL(kind=
dp),
DIMENSION(0:5) :: zbl_poly = 0.0_dp
380 REAL(kind=
dp),
DIMENSION(2) :: zbl_rcut = 0.0_dp
381 LOGICAL :: undef = .false., &
384 INTEGER :: shell_type = 0
385 CHARACTER(LEN=default_string_length) :: at1 =
""
386 CHARACTER(LEN=default_string_length) :: at2 =
""
387 INTEGER,
POINTER,
DIMENSION(:) ::
TYPE => null()
388 TYPE(pot_set_type),
POINTER,
DIMENSION(:) :: set => null()
394 TYPE pair_potential_type
396 END TYPE pair_potential_type
400 TYPE(pair_potential_type),
DIMENSION(:),
POINTER :: pot => null()
405 TYPE(pair_potential_type),
DIMENSION(:, :),
POINTER :: pot => null()
419 LOGICAL,
INTENT(OUT) :: compare
427 cpassert(
ASSOCIATED(pot1%type))
428 cpassert(
ASSOCIATED(pot2%type))
429 IF (
SIZE(pot1%type) /=
SIZE(pot2%type))
RETURN
430 IF (any(pot1%type /= pot2%type))
RETURN
433 cpassert(
ASSOCIATED(pot1%set))
434 cpassert(
ASSOCIATED(pot2%set))
435 DO i = 1,
SIZE(pot1%type)
437 SELECT CASE (pot1%type(i))
439 IF ((pot1%set(i)%lj%epsilon == pot2%set(i)%lj%epsilon) .AND. &
440 (pot1%set(i)%lj%sigma6 == pot2%set(i)%lj%sigma6) .AND. &
441 (pot1%set(i)%lj%sigma12 == pot2%set(i)%lj%sigma12)) mycompare = .true.
443 IF ((pot1%set(i)%willis%a == pot2%set(i)%willis%a) .AND. &
444 (pot1%set(i)%willis%b == pot2%set(i)%willis%b) .AND. &
445 (pot1%set(i)%willis%c == pot2%set(i)%willis%c)) mycompare = .true.
447 IF ((pot1%set(i)%goodwin%vr0 == pot2%set(i)%goodwin%vr0) .AND. &
448 (pot1%set(i)%goodwin%m == pot2%set(i)%goodwin%m) .AND. &
449 (pot1%set(i)%goodwin%mc == pot2%set(i)%goodwin%mc) .AND. &
450 (pot1%set(i)%goodwin%d == pot2%set(i)%goodwin%d) .AND. &
451 (pot1%set(i)%goodwin%dc == pot2%set(i)%goodwin%dc)) mycompare = .true.
454 IF (pot1%set(i)%eam%npoints == pot2%set(i)%eam%npoints)
THEN
455 IF ((pot1%set(i)%eam%drar == pot2%set(i)%eam%drar) .AND. &
456 (pot1%set(i)%eam%drhoar == pot2%set(i)%eam%drhoar) .AND. &
457 (pot1%set(i)%eam%acutal == pot2%set(i)%eam%acutal) .AND. &
458 (sum(abs(pot1%set(i)%eam%rho - pot2%set(i)%eam%rho)) == 0.0_dp) .AND. &
459 (sum(abs(pot1%set(i)%eam%phi - pot2%set(i)%eam%phi)) == 0.0_dp) .AND. &
460 (sum(abs(pot1%set(i)%eam%frho - pot2%set(i)%eam%frho)) == 0.0_dp) .AND. &
461 (sum(abs(pot1%set(i)%eam%rhoval - pot2%set(i)%eam%rhoval)) == 0.0_dp) .AND. &
462 (sum(abs(pot1%set(i)%eam%rval - pot2%set(i)%eam%rval)) == 0.0_dp) .AND. &
463 (sum(abs(pot1%set(i)%eam%rhop - pot2%set(i)%eam%rhop)) == 0.0_dp) .AND. &
464 (sum(abs(pot1%set(i)%eam%phip - pot2%set(i)%eam%phip)) == 0.0_dp) .AND. &
465 (sum(abs(pot1%set(i)%eam%frhop - pot2%set(i)%eam%frhop)) == 0.0_dp)) mycompare = .true.
468 IF ((pot1%set(i)%ace%ace_file_name == pot2%set(i)%ace%ace_file_name) .AND. &
469 (pot1%set(i)%ace%atom_ace_type == pot2%set(i)%ace%atom_ace_type)) mycompare = .true.
471 IF ((pot1%set(i)%deepmd%deepmd_file_name == pot2%set(i)%deepmd%deepmd_file_name) .AND. &
472 (pot1%set(i)%deepmd%atom_deepmd_type == pot2%set(i)%deepmd%atom_deepmd_type)) mycompare = .true.
474 IF ((pot1%set(i)%nequip%pot_file_name == pot2%set(i)%nequip%pot_file_name) .AND. &
475 (pot1%set(i)%nequip%unit_length == pot2%set(i)%nequip%unit_length) .AND. &
476 (pot1%set(i)%nequip%unit_forces == pot2%set(i)%nequip%unit_forces) .AND. &
477 (pot1%set(i)%nequip%unit_energy == pot2%set(i)%nequip%unit_energy)) mycompare = .true.
479 IF ((pot1%set(i)%ft%A == pot2%set(i)%ft%A) .AND. &
480 (pot1%set(i)%ft%B == pot2%set(i)%ft%B) .AND. &
481 (pot1%set(i)%ft%C == pot2%set(i)%ft%C) .AND. &
482 (pot1%set(i)%ft%D == pot2%set(i)%ft%D)) mycompare = .true.
484 IF ((pot1%set(i)%ftd%A == pot2%set(i)%ftd%A) .AND. &
485 (pot1%set(i)%ftd%B == pot2%set(i)%ftd%B) .AND. &
486 (pot1%set(i)%ftd%C == pot2%set(i)%ftd%C) .AND. &
487 (pot1%set(i)%ftd%D == pot2%set(i)%ftd%D) .AND. &
488 (all(pot1%set(i)%ftd%BD(:) == pot2%set(i)%ftd%BD(:)))) mycompare = .true.
490 IF ((sum(abs(pot1%set(i)%ipbv%a - pot2%set(i)%ipbv%a)) == 0.0_dp) .AND. &
491 (pot1%set(i)%ipbv%rcore == pot2%set(i)%ipbv%rcore) .AND. &
492 (pot1%set(i)%ipbv%m == pot2%set(i)%ipbv%m) .AND. &
493 (pot1%set(i)%ipbv%b == pot2%set(i)%ipbv%b)) mycompare = .true.
495 IF ((pot1%set(i)%tersoff%A == pot2%set(i)%tersoff%A) .AND. &
496 (pot1%set(i)%tersoff%B == pot2%set(i)%tersoff%B) .AND. &
497 (pot1%set(i)%tersoff%lambda1 == pot2%set(i)%tersoff%lambda1) .AND. &
498 (pot1%set(i)%tersoff%lambda2 == pot2%set(i)%tersoff%lambda2) .AND. &
499 (pot1%set(i)%tersoff%alpha == pot2%set(i)%tersoff%alpha) .AND. &
500 (pot1%set(i)%tersoff%beta == pot2%set(i)%tersoff%beta) .AND. &
501 (pot1%set(i)%tersoff%n == pot2%set(i)%tersoff%n) .AND. &
502 (pot1%set(i)%tersoff%c == pot2%set(i)%tersoff%c) .AND. &
503 (pot1%set(i)%tersoff%d == pot2%set(i)%tersoff%d) .AND. &
504 (pot1%set(i)%tersoff%h == pot2%set(i)%tersoff%h) .AND. &
505 (pot1%set(i)%tersoff%lambda3 == pot2%set(i)%tersoff%lambda3) .AND. &
506 (pot1%set(i)%tersoff%rcutsq == pot2%set(i)%tersoff%rcutsq) .AND. &
507 (pot1%set(i)%tersoff%bigR == pot2%set(i)%tersoff%bigR) .AND. &
508 (pot1%set(i)%tersoff%bigD == pot2%set(i)%tersoff%bigD)) mycompare = .true.
510 IF ((pot1%set(i)%siepmann%B == pot2%set(i)%siepmann%B) .AND. &
511 (pot1%set(i)%siepmann%D == pot2%set(i)%siepmann%D) .AND. &
512 (pot1%set(i)%siepmann%E == pot2%set(i)%siepmann%E) .AND. &
513 (pot1%set(i)%siepmann%F == pot2%set(i)%siepmann%F) .AND. &
514 (pot1%set(i)%siepmann%beta == pot2%set(i)%siepmann%beta) .AND. &
515 (pot1%set(i)%siepmann%rcutsq == pot2%set(i)%siepmann%rcutsq) .AND. &
516 (pot1%set(i)%siepmann%allow_oh_formation .EQV. &
517 pot2%set(i)%siepmann%allow_oh_formation) .AND. &
518 (pot1%set(i)%siepmann%allow_o_formation .EQV. &
519 pot2%set(i)%siepmann%allow_o_formation) .AND. &
520 (pot1%set(i)%siepmann%allow_h3o_formation .EQV. &
521 pot2%set(i)%siepmann%allow_h3o_formation)) mycompare = .true.
523 IF ((pot1%set(i)%gal%epsilon == pot2%set(i)%gal%epsilon) .AND. &
524 (pot1%set(i)%gal%bxy == pot2%set(i)%gal%bxy) .AND. &
525 (pot1%set(i)%gal%bz == pot2%set(i)%gal%bz) .AND. &
526 (pot1%set(i)%gal%r1 == pot2%set(i)%gal%r1) .AND. &
527 (pot1%set(i)%gal%r2 == pot2%set(i)%gal%r2) .AND. &
528 (pot1%set(i)%gal%a1 == pot2%set(i)%gal%a1) .AND. &
529 (pot1%set(i)%gal%a2 == pot2%set(i)%gal%a2) .AND. &
530 (pot1%set(i)%gal%a3 == pot2%set(i)%gal%a3) .AND. &
531 (pot1%set(i)%gal%a4 == pot2%set(i)%gal%a4) .AND. &
532 (pot1%set(i)%gal%a == pot2%set(i)%gal%a) .AND. &
533 (pot1%set(i)%gal%b == pot2%set(i)%gal%b) .AND. &
534 (pot1%set(i)%gal%c == pot2%set(i)%gal%c) .AND. &
535 (pot1%set(i)%gal%express .EQV. &
536 pot2%set(i)%gal%express) .AND. &
537 (pot1%set(i)%gal%rcutsq == pot2%set(i)%gal%rcutsq)) mycompare = .true.
539 IF ((pot1%set(i)%gal21%epsilon1 == pot2%set(i)%gal21%epsilon1) .AND. &
540 (pot1%set(i)%gal21%epsilon2 == pot2%set(i)%gal21%epsilon2) .AND. &
541 (pot1%set(i)%gal21%epsilon3 == pot2%set(i)%gal21%epsilon3) .AND. &
542 (pot1%set(i)%gal21%bxy1 == pot2%set(i)%gal21%bxy1) .AND. &
543 (pot1%set(i)%gal21%bxy2 == pot2%set(i)%gal21%bxy1) .AND. &
544 (pot1%set(i)%gal21%bz1 == pot2%set(i)%gal21%bz1) .AND. &
545 (pot1%set(i)%gal21%bz2 == pot2%set(i)%gal21%bz2) .AND. &
546 (pot1%set(i)%gal21%r1 == pot2%set(i)%gal21%r1) .AND. &
547 (pot1%set(i)%gal21%r2 == pot2%set(i)%gal21%r2) .AND. &
548 (pot1%set(i)%gal21%a11 == pot2%set(i)%gal21%a11) .AND. &
549 (pot1%set(i)%gal21%a12 == pot2%set(i)%gal21%a12) .AND. &
550 (pot1%set(i)%gal21%a13 == pot2%set(i)%gal21%a13) .AND. &
551 (pot1%set(i)%gal21%a21 == pot2%set(i)%gal21%a21) .AND. &
552 (pot1%set(i)%gal21%a22 == pot2%set(i)%gal21%a22) .AND. &
553 (pot1%set(i)%gal21%a23 == pot2%set(i)%gal21%a23) .AND. &
554 (pot1%set(i)%gal21%a31 == pot2%set(i)%gal21%a31) .AND. &
555 (pot1%set(i)%gal21%a32 == pot2%set(i)%gal21%a32) .AND. &
556 (pot1%set(i)%gal21%a33 == pot2%set(i)%gal21%a33) .AND. &
557 (pot1%set(i)%gal21%a41 == pot2%set(i)%gal21%a41) .AND. &
558 (pot1%set(i)%gal21%a42 == pot2%set(i)%gal21%a42) .AND. &
559 (pot1%set(i)%gal21%a43 == pot2%set(i)%gal21%a43) .AND. &
560 (pot1%set(i)%gal21%AO1 == pot2%set(i)%gal21%AO1) .AND. &
561 (pot1%set(i)%gal21%AO2 == pot2%set(i)%gal21%AO2) .AND. &
562 (pot1%set(i)%gal21%BO1 == pot2%set(i)%gal21%BO1) .AND. &
563 (pot1%set(i)%gal21%BO2 == pot2%set(i)%gal21%BO2) .AND. &
564 (pot1%set(i)%gal21%c == pot2%set(i)%gal21%c) .AND. &
565 (pot1%set(i)%gal21%AH1 == pot2%set(i)%gal21%AH1) .AND. &
566 (pot1%set(i)%gal21%AH2 == pot2%set(i)%gal21%AH2) .AND. &
567 (pot1%set(i)%gal21%BH1 == pot2%set(i)%gal21%BH1) .AND. &
568 (pot1%set(i)%gal21%BH2 == pot2%set(i)%gal21%BH2) .AND. &
569 (pot1%set(i)%gal21%express .EQV. &
570 pot2%set(i)%gal21%express) .AND. &
571 (pot1%set(i)%gal21%rcutsq == pot2%set(i)%gal21%rcutsq)) mycompare = .true.
574 mycompare = mycompare .AND. &
575 (pot1%set(i)%rmin == pot2%set(i)%rmin) .AND. (pot1%set(i)%rmax == pot2%set(i)%rmax)
576 IF ((mycompare) .AND. (i == 1)) compare = .true.
577 compare = compare .AND. mycompare
588 SUBROUTINE pair_potential_single_create(potparm, nset)
590 INTEGER,
INTENT(IN),
OPTIONAL :: nset
594 cpassert(.NOT.
ASSOCIATED(potparm))
597 IF (
PRESENT(nset)) lnset = nset
599 ALLOCATE (potparm%type(lnset))
600 ALLOCATE (potparm%set(lnset))
601 NULLIFY (potparm%spl_f, &
602 potparm%pair_spline_data)
606 NULLIFY (potparm%set(i)%ipbv, &
610 potparm%set(i)%willis, &
611 potparm%set(i)%goodwin, &
612 potparm%set(i)%eam, &
613 potparm%set(i)%nequip, &
614 potparm%set(i)%ace, &
615 potparm%set(i)%deepmd, &
616 potparm%set(i)%buck4r, &
617 potparm%set(i)%buckmo, &
618 potparm%set(i)%tersoff, &
619 potparm%set(i)%siepmann, &
620 potparm%set(i)%gal, &
621 potparm%set(i)%gal21, &
622 potparm%set(i)%ftd, &
626 END SUBROUTINE pair_potential_single_create
640 potparm%undef = .true.
641 potparm%no_pp = .false.
642 potparm%no_mb = .false.
645 potparm%rcutsq = 0.0_dp
646 IF (
ASSOCIATED(potparm%pair_spline_data))
THEN
649 IF (
ASSOCIATED(potparm%spl_f))
THEN
653 DO i = 1,
SIZE(potparm%type)
656 CALL pair_potential_lj_clean(potparm%set(i)%lj)
657 CALL pair_potential_williams_clean(potparm%set(i)%willis)
658 CALL pair_potential_goodwin_clean(potparm%set(i)%goodwin)
659 CALL pair_potential_eam_clean(potparm%set(i)%eam)
660 CALL pair_potential_nequip_clean(potparm%set(i)%nequip)
661 CALL pair_potential_ace_clean(potparm%set(i)%ace)
662 CALL pair_potential_deepmd_clean(potparm%set(i)%deepmd)
663 CALL pair_potential_buck4r_clean(potparm%set(i)%buck4r)
664 CALL pair_potential_buckmo_clean(potparm%set(i)%buckmo)
665 CALL pair_potential_bmhft_clean(potparm%set(i)%ft)
666 CALL pair_potential_bmhftd_clean(potparm%set(i)%ftd)
667 CALL pair_potential_ipbv_clean(potparm%set(i)%ipbv)
668 CALL pair_potential_gp_clean(potparm%set(i)%gp)
669 CALL pair_potential_tersoff_clean(potparm%set(i)%tersoff)
670 CALL pair_potential_siepmann_clean(potparm%set(i)%siepmann)
671 CALL pair_potential_gal_clean(potparm%set(i)%gal)
672 CALL pair_potential_gal21_clean(potparm%set(i)%gal21)
673 CALL pair_potential_tab_clean(potparm%set(i)%tab)
688 cpassert(
ASSOCIATED(potparm_source))
689 IF (.NOT.
ASSOCIATED(potparm_dest))
THEN
690 CALL pair_potential_single_create(potparm_dest,
SIZE(potparm_source%type))
694 potparm_dest%type = potparm_source%type
695 potparm_dest%shell_type = potparm_source%shell_type
696 potparm_dest%undef = potparm_source%undef
697 potparm_dest%no_mb = potparm_source%no_mb
698 potparm_dest%no_pp = potparm_source%no_pp
699 potparm_dest%at1 = potparm_source%at1
700 potparm_dest%at2 = potparm_source%at2
701 potparm_dest%rcutsq = potparm_source%rcutsq
702 IF (
ASSOCIATED(potparm_source%pair_spline_data))
THEN
703 CALL spline_data_p_copy(potparm_source%pair_spline_data, potparm_dest%pair_spline_data)
706 IF (
ASSOCIATED(potparm_source%spl_f))
THEN
710 DO i = 1,
SIZE(potparm_source%type)
711 potparm_dest%set(i)%rmin = potparm_source%set(i)%rmin
712 potparm_dest%set(i)%rmax = potparm_source%set(i)%rmax
713 CALL pair_potential_lj_copy(potparm_source%set(i)%lj, potparm_dest%set(i)%lj)
714 CALL pair_potential_williams_copy(potparm_source%set(i)%willis, potparm_dest%set(i)%willis)
715 CALL pair_potential_goodwin_copy(potparm_source%set(i)%goodwin, potparm_dest%set(i)%goodwin)
716 CALL pair_potential_eam_copy(potparm_source%set(i)%eam, potparm_dest%set(i)%eam)
717 CALL pair_potential_nequip_copy(potparm_source%set(i)%nequip, potparm_dest%set(i)%nequip)
718 CALL pair_potential_ace_copy(potparm_source%set(i)%ace, potparm_dest%set(i)%ace)
719 CALL pair_potential_deepmd_copy(potparm_source%set(i)%deepmd, potparm_dest%set(i)%deepmd)
720 CALL pair_potential_bmhft_copy(potparm_source%set(i)%ft, potparm_dest%set(i)%ft)
721 CALL pair_potential_bmhftd_copy(potparm_source%set(i)%ftd, potparm_dest%set(i)%ftd)
722 CALL pair_potential_ipbv_copy(potparm_source%set(i)%ipbv, potparm_dest%set(i)%ipbv)
723 CALL pair_potential_buck4r_copy(potparm_source%set(i)%buck4r, potparm_dest%set(i)%buck4r)
724 CALL pair_potential_buckmo_copy(potparm_source%set(i)%buckmo, potparm_dest%set(i)%buckmo)
725 CALL pair_potential_gp_copy(potparm_source%set(i)%gp, potparm_dest%set(i)%gp)
726 CALL pair_potential_tersoff_copy(potparm_source%set(i)%tersoff, potparm_dest%set(i)%tersoff)
727 CALL pair_potential_siepmann_copy(potparm_source%set(i)%siepmann, potparm_dest%set(i)%siepmann)
728 CALL pair_potential_gal_copy(potparm_source%set(i)%gal, potparm_dest%set(i)%gal)
729 CALL pair_potential_gal21_copy(potparm_source%set(i)%gal21, potparm_dest%set(i)%gal21)
730 CALL pair_potential_tab_copy(potparm_source%set(i)%tab, potparm_dest%set(i)%tab)
744 INTEGER :: i, j, size_dest, size_source
745 LOGICAL :: allocate_new, check
748 cpassert(
ASSOCIATED(potparm_source))
751 check = (.NOT.
ASSOCIATED(potparm_source%pair_spline_data)) .AND. &
752 (.NOT.
ASSOCIATED(potparm_source%spl_f))
754 check = (.NOT.
ASSOCIATED(potparm_dest%pair_spline_data)) .AND. &
755 (.NOT.
ASSOCIATED(potparm_dest%spl_f))
758 size_source =
SIZE(potparm_source%type)
759 allocate_new = .NOT.
ASSOCIATED(potparm_dest)
760 IF (.NOT. allocate_new)
THEN
761 size_dest =
SIZE(potparm_dest%type)
762 IF (size_dest == 1)
THEN
763 check = (
ASSOCIATED(potparm_dest%set(1)%lj)) .OR. &
764 (
ASSOCIATED(potparm_dest%set(1)%willis)) .OR. &
765 (
ASSOCIATED(potparm_dest%set(1)%goodwin)) .OR. &
766 (
ASSOCIATED(potparm_dest%set(1)%eam)) .OR. &
767 (
ASSOCIATED(potparm_dest%set(1)%nequip)) .OR. &
768 (
ASSOCIATED(potparm_dest%set(1)%ace)) .OR. &
769 (
ASSOCIATED(potparm_dest%set(1)%deepmd)) .OR. &
770 (
ASSOCIATED(potparm_dest%set(1)%ft)) .OR. &
771 (
ASSOCIATED(potparm_dest%set(1)%ftd)) .OR. &
772 (
ASSOCIATED(potparm_dest%set(1)%ipbv)) .OR. &
773 (
ASSOCIATED(potparm_dest%set(1)%buck4r)) .OR. &
774 (
ASSOCIATED(potparm_dest%set(1)%buckmo)) .OR. &
775 (
ASSOCIATED(potparm_dest%set(1)%gp)) .OR. &
776 (
ASSOCIATED(potparm_dest%set(1)%tersoff)) .OR. &
777 (
ASSOCIATED(potparm_dest%set(1)%siepmann)) .OR. &
778 (
ASSOCIATED(potparm_dest%set(1)%gal)) .OR. &
779 (
ASSOCIATED(potparm_dest%set(1)%gal)) .OR. &
780 (
ASSOCIATED(potparm_dest%set(1)%tab))
781 IF (.NOT. check)
THEN
782 allocate_new = .true.
783 CALL pair_potential_single_release(potparm_dest)
787 IF (allocate_new)
THEN
789 CALL pair_potential_single_create(potparm_dest, size_source)
790 potparm_dest%shell_type = potparm_source%shell_type
791 potparm_dest%undef = potparm_source%undef
792 potparm_dest%no_mb = potparm_source%no_mb
793 potparm_dest%no_pp = potparm_source%no_pp
794 potparm_dest%at1 = potparm_source%at1
795 potparm_dest%at2 = potparm_source%at2
796 potparm_dest%rcutsq = potparm_source%rcutsq
798 size_dest =
SIZE(potparm_dest%type)
799 NULLIFY (potparm_tmp)
801 CALL pair_potential_single_release(potparm_dest)
802 CALL pair_potential_single_create(potparm_dest, size_dest + size_source)
804 potparm_dest%shell_type = potparm_tmp%shell_type
805 potparm_dest%undef = potparm_tmp%undef
806 potparm_dest%no_mb = potparm_tmp%no_mb
807 potparm_dest%no_pp = potparm_tmp%no_pp
808 potparm_dest%at1 = potparm_tmp%at1
809 potparm_dest%at2 = potparm_tmp%at2
810 potparm_dest%rcutsq = potparm_tmp%rcutsq
812 potparm_dest%type(i) = potparm_tmp%type(i)
813 potparm_dest%set(i)%rmin = potparm_tmp%set(i)%rmin
814 potparm_dest%set(i)%rmax = potparm_tmp%set(i)%rmax
815 CALL pair_potential_lj_copy(potparm_tmp%set(i)%lj, potparm_dest%set(i)%lj)
816 CALL pair_potential_williams_copy(potparm_tmp%set(i)%willis, potparm_dest%set(i)%willis)
817 CALL pair_potential_goodwin_copy(potparm_tmp%set(i)%goodwin, potparm_dest%set(i)%goodwin)
818 CALL pair_potential_eam_copy(potparm_tmp%set(i)%eam, potparm_dest%set(i)%eam)
819 CALL pair_potential_nequip_copy(potparm_tmp%set(i)%nequip, potparm_dest%set(i)%nequip)
820 CALL pair_potential_ace_copy(potparm_tmp%set(i)%ace, potparm_dest%set(i)%ace)
821 CALL pair_potential_deepmd_copy(potparm_tmp%set(i)%deepmd, potparm_dest%set(i)%deepmd)
822 CALL pair_potential_bmhft_copy(potparm_tmp%set(i)%ft, potparm_dest%set(i)%ft)
823 CALL pair_potential_bmhftd_copy(potparm_tmp%set(i)%ftd, potparm_dest%set(i)%ftd)
824 CALL pair_potential_ipbv_copy(potparm_tmp%set(i)%ipbv, potparm_dest%set(i)%ipbv)
825 CALL pair_potential_buck4r_copy(potparm_tmp%set(i)%buck4r, potparm_dest%set(i)%buck4r)
826 CALL pair_potential_buckmo_copy(potparm_tmp%set(i)%buckmo, potparm_dest%set(i)%buckmo)
827 CALL pair_potential_gp_copy(potparm_tmp%set(i)%gp, potparm_dest%set(i)%gp)
828 CALL pair_potential_tersoff_copy(potparm_tmp%set(i)%tersoff, potparm_dest%set(i)%tersoff)
829 CALL pair_potential_siepmann_copy(potparm_tmp%set(i)%siepmann, potparm_dest%set(i)%siepmann)
830 CALL pair_potential_gal_copy(potparm_tmp%set(i)%gal, potparm_dest%set(i)%gal)
831 CALL pair_potential_gal21_copy(potparm_tmp%set(i)%gal21, potparm_dest%set(i)%gal21)
832 CALL pair_potential_tab_copy(potparm_tmp%set(i)%tab, potparm_dest%set(i)%tab)
834 CALL pair_potential_single_release(potparm_tmp)
837 check = (potparm_dest%shell_type == potparm_source%shell_type) .AND. &
838 (potparm_dest%undef .EQV. potparm_source%undef) .AND. &
839 (potparm_dest%no_mb .EQV. potparm_source%no_mb) .AND. &
840 (potparm_dest%no_pp .EQV. potparm_source%no_pp) .AND. &
841 (potparm_dest%at1 == potparm_source%at1) .AND. &
842 (potparm_dest%at2 == potparm_source%at2) .AND. &
843 (potparm_dest%rcutsq == potparm_source%rcutsq)
846 DO i = size_dest + 1, size_dest + size_source
848 potparm_dest%type(i) = potparm_source%type(j)
849 potparm_dest%set(i)%rmin = potparm_source%set(j)%rmin
850 potparm_dest%set(i)%rmax = potparm_source%set(j)%rmax
851 CALL pair_potential_lj_copy(potparm_source%set(j)%lj, potparm_dest%set(i)%lj)
852 CALL pair_potential_williams_copy(potparm_source%set(j)%willis, potparm_dest%set(i)%willis)
853 CALL pair_potential_goodwin_copy(potparm_source%set(j)%goodwin, potparm_dest%set(i)%goodwin)
854 CALL pair_potential_eam_copy(potparm_source%set(j)%eam, potparm_dest%set(i)%eam)
855 CALL pair_potential_nequip_copy(potparm_source%set(j)%nequip, potparm_dest%set(i)%nequip)
856 CALL pair_potential_ace_copy(potparm_source%set(j)%ace, potparm_dest%set(i)%ace)
857 CALL pair_potential_deepmd_copy(potparm_source%set(j)%deepmd, potparm_dest%set(i)%deepmd)
858 CALL pair_potential_bmhft_copy(potparm_source%set(j)%ft, potparm_dest%set(i)%ft)
859 CALL pair_potential_bmhftd_copy(potparm_source%set(j)%ftd, potparm_dest%set(i)%ftd)
860 CALL pair_potential_ipbv_copy(potparm_source%set(j)%ipbv, potparm_dest%set(i)%ipbv)
861 CALL pair_potential_buck4r_copy(potparm_source%set(j)%buck4r, potparm_dest%set(i)%buck4r)
862 CALL pair_potential_buckmo_copy(potparm_source%set(j)%buckmo, potparm_dest%set(i)%buckmo)
863 CALL pair_potential_gp_copy(potparm_source%set(j)%gp, potparm_dest%set(i)%gp)
864 CALL pair_potential_tersoff_copy(potparm_source%set(j)%tersoff, potparm_dest%set(i)%tersoff)
865 CALL pair_potential_siepmann_copy(potparm_source%set(j)%siepmann, potparm_dest%set(i)%siepmann)
866 CALL pair_potential_gal_copy(potparm_source%set(j)%gal, potparm_dest%set(i)%gal)
867 CALL pair_potential_gal21_copy(potparm_source%set(j)%gal21, potparm_dest%set(i)%gal21)
868 CALL pair_potential_tab_copy(potparm_source%set(j)%tab, potparm_dest%set(i)%tab)
877 SUBROUTINE pair_potential_single_release(potparm)
882 cpassert(
ASSOCIATED(potparm))
885 DO i = 1,
SIZE(potparm%type)
886 CALL pair_potential_ipbv_release(potparm%set(i)%ipbv)
887 CALL pair_potential_lj_release(potparm%set(i)%lj)
888 CALL pair_potential_bmhft_release(potparm%set(i)%ft)
889 CALL pair_potential_bmhftd_release(potparm%set(i)%ftd)
890 CALL pair_potential_williams_release(potparm%set(i)%willis)
891 CALL pair_potential_goodwin_release(potparm%set(i)%goodwin)
892 CALL pair_potential_eam_release(potparm%set(i)%eam)
893 CALL pair_potential_nequip_release(potparm%set(i)%nequip)
894 CALL pair_potential_ace_release(potparm%set(i)%ace)
895 CALL pair_potential_deepmd_release(potparm%set(i)%deepmd)
896 CALL pair_potential_buck4r_release(potparm%set(i)%buck4r)
897 CALL pair_potential_buckmo_release(potparm%set(i)%buckmo)
898 CALL pair_potential_gp_release(potparm%set(i)%gp)
899 CALL pair_potential_tersoff_release(potparm%set(i)%tersoff)
900 CALL pair_potential_siepmann_release(potparm%set(i)%siepmann)
901 CALL pair_potential_gal_release(potparm%set(i)%gal)
902 CALL pair_potential_gal21_release(potparm%set(i)%gal21)
903 CALL pair_potential_tab_release(potparm%set(i)%tab)
905 DEALLOCATE (potparm%type)
906 DEALLOCATE (potparm%set)
908 END SUBROUTINE pair_potential_single_release
918 INTEGER,
INTENT(IN) :: nkinds
922 cpassert(.NOT.
ASSOCIATED(potparm))
924 ALLOCATE (potparm%pot(nkinds, nkinds))
927 NULLIFY (potparm%pot(i, j)%pot)
933 CALL pair_potential_single_create(potparm%pot(i, j)%pot)
934 potparm%pot(j, i)%pot => potparm%pot(i, j)%pot
952 IF (
ASSOCIATED(potparm))
THEN
953 IF (
ASSOCIATED(potparm%pot))
THEN
954 DO i = 1,
SIZE(potparm%pot, 1)
955 DO j = i,
SIZE(potparm%pot, 2)
956 CALL pair_potential_single_release(potparm%pot(i, j)%pot)
957 NULLIFY (potparm%pot(j, i)%pot)
960 DEALLOCATE (potparm%pot)
975 SUBROUTINE pair_potential_p_create(potparm, ndim, ub, lb)
977 INTEGER,
INTENT(IN),
OPTIONAL :: ndim, ub, lb
979 INTEGER :: i, loc_lb, loc_ub
981 cpassert(.NOT.
ASSOCIATED(potparm))
984 IF (
PRESENT(ndim) .AND. (
PRESENT(ub) .OR.
PRESENT(lb)))
THEN
985 CALL cp_abort(__location__, &
986 "pair_potential_p_create expects either 1 input parameter <ndim> "// &
987 "or 2 input parameters <ub> and <lb> at each call; found <ndim> "// &
988 "together with <ub> or <lb>")
991 IF (
PRESENT(ndim))
THEN
994 ALLOCATE (potparm%pot(loc_lb:loc_ub))
995 ELSE IF (
PRESENT(lb) .AND.
PRESENT(ub))
THEN
998 ALLOCATE (potparm%pot(loc_lb:loc_ub))
1000 CALL cp_abort(__location__, &
1001 "pair_potential_p_create expects either 1 input parameter <ndim> "// &
1002 "or 2 input parameters <ub> and <lb> at each call; found none")
1004 DO i = loc_lb, loc_ub
1005 NULLIFY (potparm%pot(i)%pot)
1006 CALL pair_potential_single_create(potparm%pot(i)%pot)
1008 END SUBROUTINE pair_potential_p_create
1023 IF (
ASSOCIATED(potparm))
THEN
1024 IF (
ASSOCIATED(potparm%pot))
THEN
1025 DO i = 1,
SIZE(potparm%pot)
1026 CALL pair_potential_single_release(potparm%pot(i)%pot)
1028 DEALLOCATE (potparm%pot)
1030 DEALLOCATE (potparm)
1043 SUBROUTINE pair_potential_p_copy(source, dest, istart, iend)
1045 INTEGER,
INTENT(IN),
OPTIONAL :: istart, iend
1047 INTEGER :: i, l_end, l_start
1049 cpassert(
ASSOCIATED(source))
1050 cpassert(
ASSOCIATED(dest))
1051 l_start = lbound(source%pot, 1)
1052 l_end = ubound(source%pot, 1)
1053 IF (
PRESENT(istart)) l_start = istart
1054 IF (
PRESENT(iend)) l_end = iend
1055 DO i = l_start, l_end
1056 IF (.NOT.
ASSOCIATED(source%pot(i)%pot))
THEN
1057 CALL pair_potential_single_create(source%pot(i)%pot)
1061 END SUBROUTINE pair_potential_p_copy
1090 nequip, bmhft, bmhftd, ipbv, buck4r, buckmo, &
1091 gp, tersoff, siepmann, gal, gal21, tab, deepmd, ace)
1093 INTEGER,
INTENT(IN) :: lb1_new, ub1_new
1094 LOGICAL,
INTENT(IN),
OPTIONAL :: lj, lj_charmm, williams, goodwin, eam, nequip, bmhft, &
1095 bmhftd, ipbv, buck4r, buckmo, gp, tersoff, siepmann, gal, gal21, tab, deepmd, ace
1097 INTEGER :: i, ipot, lb1_old, std_dim, ub1_old
1098 LOGICAL :: check, lace, lbmhft, lbmhftd, lbuck4r, lbuckmo, ldeepmd, leam, lgal, lgal21, &
1099 lgoodwin, lgp, lipbv, llj, llj_charmm, lnequip, lsiepmann, ltab, ltersoff, lwilliams
1104 llj = .false.;
IF (
PRESENT(lj)) llj = lj
1105 llj_charmm = .false.;
IF (
PRESENT(lj_charmm)) llj_charmm = lj_charmm
1106 lwilliams = .false.;
IF (
PRESENT(williams)) lwilliams = williams
1107 lgoodwin = .false.;
IF (
PRESENT(goodwin)) lgoodwin = goodwin
1108 leam = .false.;
IF (
PRESENT(eam)) leam = eam
1109 lnequip = .false.;
IF (
PRESENT(nequip)) lnequip = nequip
1110 lace = .false.;
IF (
PRESENT(ace)) lace = ace
1111 ldeepmd = .false.;
IF (
PRESENT(deepmd)) ldeepmd = deepmd
1112 lbmhft = .false.;
IF (
PRESENT(bmhft)) lbmhft = bmhft
1113 lbmhftd = .false.;
IF (
PRESENT(bmhftd)) lbmhftd = bmhftd
1114 lipbv = .false.;
IF (
PRESENT(ipbv)) lipbv = ipbv
1115 lbuck4r = .false.;
IF (
PRESENT(buck4r)) lbuck4r = buck4r
1116 lbuckmo = .false.;
IF (
PRESENT(buckmo)) lbuckmo = buckmo
1117 lgp = .false.;
IF (
PRESENT(gp)) lgp = gp
1118 ltersoff = .false.;
IF (
PRESENT(tersoff)) ltersoff = tersoff
1119 lsiepmann = .false.;
IF (
PRESENT(siepmann)) lsiepmann = siepmann
1120 lgal = .false.;
IF (
PRESENT(gal)) lgal = gal
1121 lgal21 = .false.;
IF (
PRESENT(gal21)) lgal21 = gal21
1122 ltab = .false.;
IF (
PRESENT(tab)) ltab = tab
1126 check = .NOT. (llj_charmm .OR. lwilliams .OR. lgoodwin .OR. leam .OR. lnequip &
1127 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lbuckmo .OR. lgp .OR. ltersoff &
1128 .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1131 IF (llj_charmm)
THEN
1133 check = .NOT. (llj .OR. lwilliams .OR. lgoodwin .OR. leam .OR. lnequip &
1134 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lbuckmo .OR. lgp .OR. ltersoff &
1135 .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1140 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. leam .OR. lnequip &
1141 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lbuckmo .OR. lgp .OR. ltersoff &
1142 .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1147 check = .NOT. (llj .OR. llj_charmm .OR. lwilliams .OR. leam .OR. lnequip &
1148 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lbuckmo .OR. lgp .OR. ltersoff &
1149 .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1154 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. lnequip &
1155 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lbuckmo .OR. lgp .OR. ltersoff &
1156 .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1161 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam &
1162 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lbuckmo .OR. lgp .OR. ltersoff &
1163 .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1168 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1169 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lbuckmo .OR. lgp &
1170 .OR. ltersoff .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd)
1175 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1176 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lbuckmo .OR. lgp &
1177 .OR. ltersoff .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. lace)
1182 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1183 .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lbuckmo .OR. lgp .OR. ltersoff &
1184 .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1189 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1190 .OR. lbmhft .OR. lipbv .OR. lbuck4r .OR. lbuckmo .OR. lgp .OR. ltersoff &
1191 .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1196 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1197 .OR. lbmhft .OR. lbmhftd .OR. lbuck4r .OR. lbuckmo .OR. lgp .OR. ltersoff &
1198 .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1203 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1204 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuckmo .OR. lgp .OR. ltersoff &
1205 .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1210 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1211 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lgp .OR. ltersoff &
1212 .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1217 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1218 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lgp .OR. lbuckmo &
1219 .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1224 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1225 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lgp .OR. lbuckmo &
1226 .OR. ltersoff .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1231 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1232 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lgp .OR. lbuckmo &
1233 .OR. ltersoff .OR. lsiepmann .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1238 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1239 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lgp .OR. lbuckmo &
1240 .OR. ltersoff .OR. lsiepmann .OR. lgal .OR. ltab .OR. ldeepmd .OR. lace)
1245 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1246 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lgal21 .OR. lbuckmo &
1247 .OR. ltersoff .OR. lsiepmann .OR. lgal .OR. ltab .OR. ldeepmd .OR. lace)
1252 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1253 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lgp .OR. lgal21 &
1254 .OR. lbuckmo .OR. ltersoff .OR. lsiepmann .OR. lgal .OR. lace)
1260 IF (
ASSOCIATED(p))
THEN
1261 lb1_old = lbound(p%pot, 1)
1262 ub1_old = ubound(p%pot, 1)
1263 CALL pair_potential_p_create(work, lb=lb1_old, ub=ub1_old)
1264 CALL pair_potential_p_copy(p, work)
1268 CALL pair_potential_p_create(p, lb=lb1_new, ub=ub1_new)
1269 IF (
ASSOCIATED(work))
THEN
1270 CALL pair_potential_p_copy(work, p, istart=lb1_old, iend=ub1_old)
1273 DO i = ub1_old + 1, ub1_new
1274 check = (
SIZE(p%pot(i)%pot%type) == std_dim) .AND. (
SIZE(p%pot(i)%pot%type) == std_dim)
1278 p%pot(i)%pot%undef = .true.
1279 p%pot(i)%pot%no_mb = .false.
1280 p%pot(i)%pot%no_pp = .false.
1281 p%pot(i)%pot%at1 =
'NULL'
1282 p%pot(i)%pot%at2 =
'NULL'
1289 CALL pair_potential_williams_create(p%pot(i)%pot%set(std_dim)%willis)
1291 CALL pair_potential_goodwin_create(p%pot(i)%pot%set(std_dim)%goodwin)
1293 CALL pair_potential_eam_create(p%pot(i)%pot%set(std_dim)%eam)
1295 CALL pair_potential_nequip_create(p%pot(i)%pot%set(std_dim)%nequip)
1297 CALL pair_potential_ace_create(p%pot(i)%pot%set(std_dim)%ace)
1299 CALL pair_potential_deepmd_create(p%pot(i)%pot%set(std_dim)%deepmd)
1301 CALL pair_potential_bmhft_create(p%pot(i)%pot%set(std_dim)%ft)
1303 CALL pair_potential_bmhftd_create(p%pot(i)%pot%set(std_dim)%ftd)
1305 CALL pair_potential_ipbv_create(p%pot(i)%pot%set(std_dim)%ipbv)
1307 CALL pair_potential_buck4r_create(p%pot(i)%pot%set(std_dim)%buck4r)
1309 CALL pair_potential_buckmo_create(p%pot(i)%pot%set(std_dim)%buckmo)
1311 CALL pair_potential_gp_create(p%pot(i)%pot%set(std_dim)%gp)
1313 CALL pair_potential_tersoff_create(p%pot(i)%pot%set(std_dim)%tersoff)
1315 CALL pair_potential_siepmann_create(p%pot(i)%pot%set(std_dim)%siepmann)
1317 CALL pair_potential_gal_create(p%pot(i)%pot%set(std_dim)%gal)
1319 CALL pair_potential_gal21_create(p%pot(i)%pot%set(std_dim)%gal21)
1321 CALL pair_potential_tab_create(p%pot(i)%pot%set(std_dim)%tab)
1323 NULLIFY (p%pot(i)%pot%spl_f)
1324 NULLIFY (p%pot(i)%pot%pair_spline_data)
1335 SUBROUTINE pair_potential_gp_create(gp)
1336 TYPE(gp_pot_type),
POINTER :: gp
1338 cpassert(.NOT.
ASSOCIATED(gp))
1340 NULLIFY (gp%parameters)
1342 CALL pair_potential_gp_clean(gp)
1343 END SUBROUTINE pair_potential_gp_create
1351 SUBROUTINE pair_potential_gp_copy(gp_source, gp_dest)
1352 TYPE(gp_pot_type),
POINTER :: gp_source, gp_dest
1356 IF (.NOT.
ASSOCIATED(gp_source))
RETURN
1357 IF (
ASSOCIATED(gp_dest))
CALL pair_potential_gp_release(gp_dest)
1358 CALL pair_potential_gp_create(gp_dest)
1359 gp_dest%myid = gp_source%myid
1360 gp_dest%potential = gp_source%potential
1361 gp_dest%variables = gp_source%variables
1362 IF (
ASSOCIATED(gp_source%parameters))
THEN
1363 idim =
SIZE(gp_source%parameters)
1364 ALLOCATE (gp_dest%parameters(idim))
1365 gp_dest%parameters = gp_source%parameters
1367 IF (
ASSOCIATED(gp_source%values))
THEN
1368 idim =
SIZE(gp_source%values)
1369 ALLOCATE (gp_dest%values(idim))
1370 gp_dest%values = gp_source%values
1372 END SUBROUTINE pair_potential_gp_copy
1379 SUBROUTINE pair_potential_gp_clean(gp)
1380 TYPE(gp_pot_type),
POINTER :: gp
1382 IF (.NOT.
ASSOCIATED(gp))
RETURN
1386 IF (
ASSOCIATED(gp%values))
THEN
1387 DEALLOCATE (gp%values)
1389 IF (
ASSOCIATED(gp%parameters))
THEN
1390 DEALLOCATE (gp%parameters)
1392 END SUBROUTINE pair_potential_gp_clean
1399 SUBROUTINE pair_potential_gp_release(gp)
1400 TYPE(gp_pot_type),
POINTER :: gp
1402 IF (
ASSOCIATED(gp))
THEN
1403 IF (
ASSOCIATED(gp%parameters))
THEN
1404 DEALLOCATE (gp%parameters)
1406 IF (
ASSOCIATED(gp%values))
THEN
1407 DEALLOCATE (gp%values)
1412 END SUBROUTINE pair_potential_gp_release
1420 TYPE(lj_pot_type),
POINTER :: lj
1422 cpassert(.NOT.
ASSOCIATED(lj))
1424 CALL pair_potential_lj_clean(lj)
1433 SUBROUTINE pair_potential_lj_copy(lj_source, lj_dest)
1434 TYPE(lj_pot_type),
POINTER :: lj_source, lj_dest
1436 IF (.NOT.
ASSOCIATED(lj_source))
RETURN
1437 IF (
ASSOCIATED(lj_dest))
CALL pair_potential_lj_release(lj_dest)
1439 lj_dest%epsilon = lj_source%epsilon
1440 lj_dest%sigma6 = lj_source%sigma6
1441 lj_dest%sigma12 = lj_source%sigma12
1442 END SUBROUTINE pair_potential_lj_copy
1449 SUBROUTINE pair_potential_lj_clean(lj)
1450 TYPE(lj_pot_type),
POINTER :: lj
1452 IF (.NOT.
ASSOCIATED(lj))
RETURN
1456 END SUBROUTINE pair_potential_lj_clean
1463 SUBROUTINE pair_potential_lj_release(lj)
1464 TYPE(lj_pot_type),
POINTER :: lj
1466 IF (
ASSOCIATED(lj))
THEN
1470 END SUBROUTINE pair_potential_lj_release
1477 SUBROUTINE pair_potential_williams_create(willis)
1478 TYPE(williams_pot_type),
POINTER :: willis
1480 cpassert(.NOT.
ASSOCIATED(willis))
1482 CALL pair_potential_williams_clean(willis)
1483 END SUBROUTINE pair_potential_williams_create
1491 SUBROUTINE pair_potential_williams_copy(willis_source, willis_dest)
1492 TYPE(williams_pot_type),
POINTER :: willis_source, willis_dest
1494 IF (.NOT.
ASSOCIATED(willis_source))
RETURN
1495 IF (
ASSOCIATED(willis_dest))
CALL pair_potential_williams_release(willis_dest)
1496 CALL pair_potential_williams_create(willis_dest)
1497 willis_dest%a = willis_source%a
1498 willis_dest%b = willis_source%b
1499 willis_dest%c = willis_source%c
1500 END SUBROUTINE pair_potential_williams_copy
1507 SUBROUTINE pair_potential_williams_clean(willis)
1508 TYPE(williams_pot_type),
POINTER :: willis
1510 IF (.NOT.
ASSOCIATED(willis))
RETURN
1514 END SUBROUTINE pair_potential_williams_clean
1521 SUBROUTINE pair_potential_williams_release(willis)
1522 TYPE(williams_pot_type),
POINTER :: willis
1524 IF (
ASSOCIATED(willis))
THEN
1528 END SUBROUTINE pair_potential_williams_release
1535 SUBROUTINE pair_potential_goodwin_create(goodwin)
1536 TYPE(goodwin_pot_type),
POINTER :: goodwin
1538 cpassert(.NOT.
ASSOCIATED(goodwin))
1540 CALL pair_potential_goodwin_clean(goodwin)
1541 END SUBROUTINE pair_potential_goodwin_create
1549 SUBROUTINE pair_potential_goodwin_copy(goodwin_source, goodwin_dest)
1550 TYPE(goodwin_pot_type),
POINTER :: goodwin_source, goodwin_dest
1552 IF (.NOT.
ASSOCIATED(goodwin_source))
RETURN
1553 IF (
ASSOCIATED(goodwin_dest))
CALL pair_potential_goodwin_release(goodwin_dest)
1554 CALL pair_potential_goodwin_create(goodwin_dest)
1555 goodwin_dest%vr0 = goodwin_source%vr0
1556 goodwin_dest%d = goodwin_source%d
1557 goodwin_dest%dc = goodwin_source%dc
1558 goodwin_dest%m = goodwin_source%m
1559 goodwin_dest%mc = goodwin_source%mc
1560 END SUBROUTINE pair_potential_goodwin_copy
1567 SUBROUTINE pair_potential_goodwin_clean(goodwin)
1568 TYPE(goodwin_pot_type),
POINTER :: goodwin
1570 IF (.NOT.
ASSOCIATED(goodwin))
RETURN
1571 goodwin%vr0 = 0.0_dp
1576 END SUBROUTINE pair_potential_goodwin_clean
1583 SUBROUTINE pair_potential_goodwin_release(goodwin)
1584 TYPE(goodwin_pot_type),
POINTER :: goodwin
1586 IF (
ASSOCIATED(goodwin))
THEN
1587 DEALLOCATE (goodwin)
1590 END SUBROUTINE pair_potential_goodwin_release
1597 SUBROUTINE pair_potential_eam_create(eam)
1600 cpassert(.NOT.
ASSOCIATED(eam))
1602 NULLIFY (eam%rho, eam%phi, eam%frho, eam%rhoval, eam%rval, &
1603 eam%rhop, eam%phip, eam%frhop)
1604 CALL pair_potential_eam_clean(eam)
1605 END SUBROUTINE pair_potential_eam_create
1613 SUBROUTINE pair_potential_eam_copy(eam_source, eam_dest)
1616 IF (.NOT.
ASSOCIATED(eam_source))
RETURN
1617 IF (
ASSOCIATED(eam_dest))
CALL pair_potential_eam_release(eam_dest)
1618 CALL pair_potential_eam_create(eam_dest)
1619 eam_dest%eam_file_name = eam_source%eam_file_name
1620 eam_dest%drar = eam_source%drar
1621 eam_dest%drhoar = eam_source%drhoar
1622 eam_dest%acutal = eam_source%acutal
1623 eam_dest%npoints = eam_source%npoints
1625 CALL reallocate(eam_dest%rho, 1, eam_dest%npoints)
1626 CALL reallocate(eam_dest%rhop, 1, eam_dest%npoints)
1627 CALL reallocate(eam_dest%phi, 1, eam_dest%npoints)
1628 CALL reallocate(eam_dest%phip, 1, eam_dest%npoints)
1629 CALL reallocate(eam_dest%frho, 1, eam_dest%npoints)
1630 CALL reallocate(eam_dest%frhop, 1, eam_dest%npoints)
1631 CALL reallocate(eam_dest%rval, 1, eam_dest%npoints)
1632 CALL reallocate(eam_dest%rhoval, 1, eam_dest%npoints)
1633 eam_dest%rho = eam_source%rho
1634 eam_dest%phi = eam_source%phi
1635 eam_dest%frho = eam_source%frho
1636 eam_dest%rhoval = eam_source%rhoval
1637 eam_dest%rval = eam_source%rval
1638 eam_dest%rhop = eam_source%rhop
1639 eam_dest%phip = eam_source%phip
1640 eam_dest%frhop = eam_source%frhop
1641 END SUBROUTINE pair_potential_eam_copy
1648 SUBROUTINE pair_potential_eam_clean(eam)
1651 IF (.NOT.
ASSOCIATED(eam))
RETURN
1652 eam%eam_file_name =
'NULL'
1665 END SUBROUTINE pair_potential_eam_clean
1672 SUBROUTINE pair_potential_eam_release(eam)
1675 IF (
ASSOCIATED(eam))
THEN
1676 IF (
ASSOCIATED(eam%rho))
THEN
1677 DEALLOCATE (eam%rho)
1679 IF (
ASSOCIATED(eam%rhop))
THEN
1680 DEALLOCATE (eam%rhop)
1682 IF (
ASSOCIATED(eam%phi))
THEN
1683 DEALLOCATE (eam%phi)
1685 IF (
ASSOCIATED(eam%phip))
THEN
1686 DEALLOCATE (eam%phip)
1688 IF (
ASSOCIATED(eam%frho))
THEN
1689 DEALLOCATE (eam%frho)
1691 IF (
ASSOCIATED(eam%frhop))
THEN
1692 DEALLOCATE (eam%frhop)
1694 IF (
ASSOCIATED(eam%rval))
THEN
1695 DEALLOCATE (eam%rval)
1697 IF (
ASSOCIATED(eam%rhoval))
THEN
1698 DEALLOCATE (eam%rhoval)
1702 END SUBROUTINE pair_potential_eam_release
1709 SUBROUTINE pair_potential_ace_create(ace)
1712 cpassert(.NOT.
ASSOCIATED(ace))
1714 END SUBROUTINE pair_potential_ace_create
1722 SUBROUTINE pair_potential_ace_copy(ace_source, ace_dest)
1725 IF (.NOT.
ASSOCIATED(ace_source))
RETURN
1727 IF (
ASSOCIATED(ace_dest))
CALL pair_potential_ace_release(ace_dest)
1728 CALL pair_potential_ace_create(ace_dest)
1729 ace_dest = ace_source
1730 END SUBROUTINE pair_potential_ace_copy
1737 SUBROUTINE pair_potential_ace_clean(ace)
1740 IF (.NOT.
ASSOCIATED(ace))
RETURN
1742 END SUBROUTINE pair_potential_ace_clean
1749 SUBROUTINE pair_potential_ace_release(ace)
1752 IF (
ASSOCIATED(ace))
THEN
1755 END SUBROUTINE pair_potential_ace_release
1762 SUBROUTINE pair_potential_deepmd_create(deepmd)
1765 cpassert(.NOT.
ASSOCIATED(deepmd))
1767 END SUBROUTINE pair_potential_deepmd_create
1775 SUBROUTINE pair_potential_deepmd_copy(deepmd_source, deepmd_dest)
1778 IF (.NOT.
ASSOCIATED(deepmd_source))
RETURN
1779 NULLIFY (deepmd_dest)
1780 IF (
ASSOCIATED(deepmd_dest))
CALL pair_potential_deepmd_release(deepmd_dest)
1781 CALL pair_potential_deepmd_create(deepmd_dest)
1782 deepmd_dest = deepmd_source
1783 END SUBROUTINE pair_potential_deepmd_copy
1790 SUBROUTINE pair_potential_deepmd_clean(deepmd)
1793 IF (.NOT.
ASSOCIATED(deepmd))
RETURN
1795 END SUBROUTINE pair_potential_deepmd_clean
1802 SUBROUTINE pair_potential_deepmd_release(deepmd)
1805 IF (
ASSOCIATED(deepmd))
THEN
1808 END SUBROUTINE pair_potential_deepmd_release
1815 SUBROUTINE pair_potential_nequip_create(nequip)
1818 cpassert(.NOT.
ASSOCIATED(nequip))
1820 END SUBROUTINE pair_potential_nequip_create
1828 SUBROUTINE pair_potential_nequip_copy(nequip_source, nequip_dest)
1831 IF (.NOT.
ASSOCIATED(nequip_source))
RETURN
1832 IF (
ASSOCIATED(nequip_dest))
CALL pair_potential_nequip_release(nequip_dest)
1833 CALL pair_potential_nequip_create(nequip_dest)
1834 nequip_dest = nequip_source
1836 END SUBROUTINE pair_potential_nequip_copy
1843 SUBROUTINE pair_potential_nequip_clean(nequip)
1846 IF (.NOT.
ASSOCIATED(nequip))
RETURN
1849 END SUBROUTINE pair_potential_nequip_clean
1856 SUBROUTINE pair_potential_nequip_release(nequip)
1859 IF (
ASSOCIATED(nequip))
THEN
1862 END SUBROUTINE pair_potential_nequip_release
1869 SUBROUTINE pair_potential_bmhft_create(ft)
1872 cpassert(.NOT.
ASSOCIATED(ft))
1874 CALL pair_potential_bmhft_clean(ft)
1875 END SUBROUTINE pair_potential_bmhft_create
1883 SUBROUTINE pair_potential_bmhft_copy(ft_source, ft_dest)
1886 IF (.NOT.
ASSOCIATED(ft_source))
RETURN
1887 IF (
ASSOCIATED(ft_dest))
CALL pair_potential_bmhft_release(ft_dest)
1888 CALL pair_potential_bmhft_create(ft_dest)
1889 ft_dest%A = ft_source%A
1890 ft_dest%B = ft_source%B
1891 ft_dest%C = ft_source%C
1892 ft_dest%D = ft_source%D
1893 END SUBROUTINE pair_potential_bmhft_copy
1900 SUBROUTINE pair_potential_bmhft_clean(ft)
1903 IF (.NOT.
ASSOCIATED(ft))
RETURN
1908 END SUBROUTINE pair_potential_bmhft_clean
1915 SUBROUTINE pair_potential_bmhft_release(ft)
1918 IF (
ASSOCIATED(ft))
THEN
1922 END SUBROUTINE pair_potential_bmhft_release
1929 SUBROUTINE pair_potential_bmhftd_create(ftd)
1930 TYPE(ftd_pot_type),
POINTER :: ftd
1932 cpassert(.NOT.
ASSOCIATED(ftd))
1934 CALL pair_potential_bmhftd_clean(ftd)
1935 END SUBROUTINE pair_potential_bmhftd_create
1943 SUBROUTINE pair_potential_bmhftd_copy(ftd_source, ftd_dest)
1944 TYPE(ftd_pot_type),
POINTER :: ftd_source, ftd_dest
1946 IF (.NOT.
ASSOCIATED(ftd_source))
RETURN
1947 IF (
ASSOCIATED(ftd_dest))
CALL pair_potential_bmhftd_release(ftd_dest)
1948 CALL pair_potential_bmhftd_create(ftd_dest)
1949 ftd_dest%A = ftd_source%A
1950 ftd_dest%B = ftd_source%B
1951 ftd_dest%C = ftd_source%C
1952 ftd_dest%D = ftd_source%D
1953 ftd_dest%BD = ftd_source%BD
1954 END SUBROUTINE pair_potential_bmhftd_copy
1961 SUBROUTINE pair_potential_bmhftd_clean(ftd)
1962 TYPE(ftd_pot_type),
POINTER :: ftd
1964 IF (.NOT.
ASSOCIATED(ftd))
RETURN
1970 END SUBROUTINE pair_potential_bmhftd_clean
1977 SUBROUTINE pair_potential_bmhftd_release(ftd)
1978 TYPE(ftd_pot_type),
POINTER :: ftd
1980 IF (
ASSOCIATED(ftd))
THEN
1984 END SUBROUTINE pair_potential_bmhftd_release
1991 SUBROUTINE pair_potential_ipbv_create(ipbv)
1994 cpassert(.NOT.
ASSOCIATED(ipbv))
1996 CALL pair_potential_ipbv_clean(ipbv)
1997 END SUBROUTINE pair_potential_ipbv_create
2005 SUBROUTINE pair_potential_ipbv_copy(ipbv_source, ipbv_dest)
2008 IF (.NOT.
ASSOCIATED(ipbv_source))
RETURN
2009 IF (
ASSOCIATED(ipbv_dest))
CALL pair_potential_ipbv_release(ipbv_dest)
2010 CALL pair_potential_ipbv_create(ipbv_dest)
2011 ipbv_dest%a = ipbv_source%a
2012 ipbv_dest%rcore = ipbv_source%rcore
2013 ipbv_dest%b = ipbv_source%b
2014 ipbv_dest%m = ipbv_source%m
2015 END SUBROUTINE pair_potential_ipbv_copy
2022 SUBROUTINE pair_potential_ipbv_clean(ipbv)
2025 IF (.NOT.
ASSOCIATED(ipbv))
RETURN
2030 END SUBROUTINE pair_potential_ipbv_clean
2037 SUBROUTINE pair_potential_ipbv_release(ipbv)
2040 IF (
ASSOCIATED(ipbv))
THEN
2044 END SUBROUTINE pair_potential_ipbv_release
2051 SUBROUTINE pair_potential_buck4r_create(buck4r)
2052 TYPE(buck4ran_pot_type),
POINTER :: buck4r
2054 cpassert(.NOT.
ASSOCIATED(buck4r))
2056 CALL pair_potential_buck4r_clean(buck4r)
2057 END SUBROUTINE pair_potential_buck4r_create
2065 SUBROUTINE pair_potential_buck4r_copy(buck4r_source, buck4r_dest)
2066 TYPE(buck4ran_pot_type),
POINTER :: buck4r_source, buck4r_dest
2068 IF (.NOT.
ASSOCIATED(buck4r_source))
RETURN
2069 IF (
ASSOCIATED(buck4r_dest))
CALL pair_potential_buck4r_release(buck4r_dest)
2070 CALL pair_potential_buck4r_create(buck4r_dest)
2071 buck4r_dest%a = buck4r_source%a
2072 buck4r_dest%b = buck4r_source%b
2073 buck4r_dest%c = buck4r_source%c
2074 buck4r_dest%r1 = buck4r_source%r1
2075 buck4r_dest%r2 = buck4r_source%r2
2076 buck4r_dest%r3 = buck4r_source%r3
2077 buck4r_dest%poly1 = buck4r_source%poly1
2078 buck4r_dest%poly2 = buck4r_source%poly2
2079 buck4r_dest%npoly1 = buck4r_source%npoly1
2080 buck4r_dest%npoly2 = buck4r_source%npoly2
2081 END SUBROUTINE pair_potential_buck4r_copy
2088 SUBROUTINE pair_potential_buck4r_clean(buck4r)
2089 TYPE(buck4ran_pot_type),
POINTER :: buck4r
2091 IF (.NOT.
ASSOCIATED(buck4r))
RETURN
2098 buck4r%poly1 = 0.0_dp
2100 buck4r%poly2 = 0.0_dp
2102 END SUBROUTINE pair_potential_buck4r_clean
2109 SUBROUTINE pair_potential_buck4r_release(buck4r)
2110 TYPE(buck4ran_pot_type),
POINTER :: buck4r
2112 IF (
ASSOCIATED(buck4r))
THEN
2116 END SUBROUTINE pair_potential_buck4r_release
2123 SUBROUTINE pair_potential_buckmo_create(buckmo)
2124 TYPE(buckmorse_pot_type),
POINTER :: buckmo
2126 cpassert(.NOT.
ASSOCIATED(buckmo))
2128 CALL pair_potential_buckmo_clean(buckmo)
2129 END SUBROUTINE pair_potential_buckmo_create
2137 SUBROUTINE pair_potential_buckmo_copy(buckmo_source, buckmo_dest)
2138 TYPE(buckmorse_pot_type),
POINTER :: buckmo_source, buckmo_dest
2140 IF (.NOT.
ASSOCIATED(buckmo_source))
RETURN
2141 IF (
ASSOCIATED(buckmo_dest))
CALL pair_potential_buckmo_release(buckmo_dest)
2142 CALL pair_potential_buckmo_create(buckmo_dest)
2143 buckmo_dest%f0 = buckmo_source%f0
2144 buckmo_dest%a1 = buckmo_source%a1
2145 buckmo_dest%a2 = buckmo_source%a2
2146 buckmo_dest%b1 = buckmo_source%b1
2147 buckmo_dest%b2 = buckmo_source%b2
2148 buckmo_dest%c = buckmo_source%c
2149 buckmo_dest%d = buckmo_source%d
2150 buckmo_dest%r0 = buckmo_source%r0
2151 buckmo_dest%beta = buckmo_source%beta
2152 END SUBROUTINE pair_potential_buckmo_copy
2159 SUBROUTINE pair_potential_buckmo_clean(buckmo)
2160 TYPE(buckmorse_pot_type),
POINTER :: buckmo
2162 IF (.NOT.
ASSOCIATED(buckmo))
RETURN
2171 buckmo%beta = 0.0_dp
2172 END SUBROUTINE pair_potential_buckmo_clean
2179 SUBROUTINE pair_potential_buckmo_release(buckmo)
2180 TYPE(buckmorse_pot_type),
POINTER :: buckmo
2182 IF (
ASSOCIATED(buckmo))
THEN
2186 END SUBROUTINE pair_potential_buckmo_release
2193 SUBROUTINE pair_potential_tersoff_create(tersoff)
2196 cpassert(.NOT.
ASSOCIATED(tersoff))
2198 CALL pair_potential_tersoff_clean(tersoff)
2199 END SUBROUTINE pair_potential_tersoff_create
2207 SUBROUTINE pair_potential_tersoff_copy(tersoff_source, tersoff_dest)
2210 IF (.NOT.
ASSOCIATED(tersoff_source))
RETURN
2211 IF (
ASSOCIATED(tersoff_dest))
CALL pair_potential_tersoff_release(tersoff_dest)
2212 CALL pair_potential_tersoff_create(tersoff_dest)
2213 tersoff_dest%A = tersoff_source%A
2214 tersoff_dest%B = tersoff_source%B
2215 tersoff_dest%lambda1 = tersoff_source%lambda1
2216 tersoff_dest%lambda2 = tersoff_source%lambda2
2217 tersoff_dest%alpha = tersoff_source%alpha
2218 tersoff_dest%beta = tersoff_source%beta
2219 tersoff_dest%n = tersoff_source%n
2220 tersoff_dest%c = tersoff_source%c
2221 tersoff_dest%d = tersoff_source%d
2222 tersoff_dest%h = tersoff_source%h
2223 tersoff_dest%lambda3 = tersoff_source%lambda3
2224 tersoff_dest%bigR = tersoff_source%bigR
2225 tersoff_dest%bigD = tersoff_source%bigD
2226 tersoff_dest%rcutsq = tersoff_source%rcutsq
2227 END SUBROUTINE pair_potential_tersoff_copy
2234 SUBROUTINE pair_potential_tersoff_clean(tersoff)
2237 IF (.NOT.
ASSOCIATED(tersoff))
RETURN
2240 tersoff%lambda1 = 0.0_dp
2241 tersoff%lambda2 = 0.0_dp
2242 tersoff%alpha = 0.0_dp
2243 tersoff%beta = 0.0_dp
2248 tersoff%lambda3 = 0.0_dp
2249 tersoff%bigR = 0.0_dp
2250 tersoff%bigD = 0.0_dp
2251 tersoff%rcutsq = 0.0_dp
2252 END SUBROUTINE pair_potential_tersoff_clean
2259 SUBROUTINE pair_potential_tersoff_release(tersoff)
2262 IF (
ASSOCIATED(tersoff))
THEN
2263 DEALLOCATE (tersoff)
2266 END SUBROUTINE pair_potential_tersoff_release
2273 SUBROUTINE pair_potential_siepmann_create(siepmann)
2276 cpassert(.NOT.
ASSOCIATED(siepmann))
2278 CALL pair_potential_siepmann_clean(siepmann)
2279 END SUBROUTINE pair_potential_siepmann_create
2286 SUBROUTINE pair_potential_siepmann_copy(siepmann_source, siepmann_dest)
2289 IF (.NOT.
ASSOCIATED(siepmann_source))
RETURN
2290 IF (
ASSOCIATED(siepmann_dest))
CALL pair_potential_siepmann_release(siepmann_dest)
2291 CALL pair_potential_siepmann_create(siepmann_dest)
2292 siepmann_dest%B = siepmann_source%B
2293 siepmann_dest%D = siepmann_source%D
2294 siepmann_dest%E = siepmann_source%E
2295 siepmann_dest%F = siepmann_source%F
2296 siepmann_dest%beta = siepmann_source%beta
2297 siepmann_dest%rcutsq = siepmann_source%rcutsq
2298 siepmann_dest%allow_oh_formation = siepmann_source%allow_oh_formation
2299 siepmann_dest%allow_h3o_formation = siepmann_source%allow_h3o_formation
2300 siepmann_dest%allow_o_formation = siepmann_source%allow_o_formation
2302 END SUBROUTINE pair_potential_siepmann_copy
2309 SUBROUTINE pair_potential_siepmann_clean(siepmann)
2312 IF (.NOT.
ASSOCIATED(siepmann))
RETURN
2317 siepmann%beta = 0.0_dp
2318 siepmann%rcutsq = 0.0_dp
2319 siepmann%allow_oh_formation = .false.
2320 siepmann%allow_h3o_formation = .false.
2321 siepmann%allow_o_formation = .false.
2323 END SUBROUTINE pair_potential_siepmann_clean
2330 SUBROUTINE pair_potential_siepmann_release(siepmann)
2333 IF (
ASSOCIATED(siepmann))
THEN
2334 DEALLOCATE (siepmann)
2337 END SUBROUTINE pair_potential_siepmann_release
2344 SUBROUTINE pair_potential_gal_create(gal)
2347 cpassert(.NOT.
ASSOCIATED(gal))
2349 CALL pair_potential_gal_clean(gal)
2350 END SUBROUTINE pair_potential_gal_create
2358 SUBROUTINE pair_potential_gal_copy(gal_source, gal_dest)
2361 IF (.NOT.
ASSOCIATED(gal_source))
RETURN
2362 IF (
ASSOCIATED(gal_dest))
CALL pair_potential_gal_release(gal_dest)
2363 CALL pair_potential_gal_create(gal_dest)
2364 gal_dest%met1 = gal_source%met1
2365 gal_dest%met2 = gal_source%met2
2366 gal_dest%epsilon = gal_source%epsilon
2367 gal_dest%bxy = gal_source%bxy
2368 gal_dest%bz = gal_source%bz
2369 gal_dest%r1 = gal_source%r1
2370 gal_dest%r2 = gal_source%r2
2371 gal_dest%a1 = gal_source%a1
2372 gal_dest%a2 = gal_source%a2
2373 gal_dest%a3 = gal_source%a3
2374 gal_dest%a4 = gal_source%a4
2375 gal_dest%a = gal_source%a
2376 gal_dest%b = gal_source%b
2377 gal_dest%c = gal_source%c
2378 ALLOCATE (gal_dest%gcn(
SIZE(gal_source%gcn)))
2379 gal_dest%gcn = gal_source%gcn
2380 gal_dest%express = gal_source%express
2381 gal_dest%rcutsq = gal_source%rcutsq
2383 END SUBROUTINE pair_potential_gal_copy
2390 SUBROUTINE pair_potential_gal_clean(gal)
2393 IF (.NOT.
ASSOCIATED(gal))
RETURN
2394 gal%epsilon = 0.0_dp
2407 gal%express = .false.
2409 END SUBROUTINE pair_potential_gal_clean
2416 SUBROUTINE pair_potential_gal_release(gal)
2419 IF (
ASSOCIATED(gal))
THEN
2420 DEALLOCATE (gal%gcn)
2424 END SUBROUTINE pair_potential_gal_release
2431 SUBROUTINE pair_potential_gal21_create(gal21)
2434 cpassert(.NOT.
ASSOCIATED(gal21))
2436 CALL pair_potential_gal21_clean(gal21)
2437 END SUBROUTINE pair_potential_gal21_create
2445 SUBROUTINE pair_potential_gal21_copy(gal21_source, gal21_dest)
2448 IF (.NOT.
ASSOCIATED(gal21_source))
RETURN
2449 IF (
ASSOCIATED(gal21_dest))
CALL pair_potential_gal21_release(gal21_dest)
2450 CALL pair_potential_gal21_create(gal21_dest)
2451 gal21_dest%met1 = gal21_source%met1
2452 gal21_dest%met2 = gal21_source%met2
2453 gal21_dest%epsilon1 = gal21_source%epsilon1
2454 gal21_dest%epsilon2 = gal21_source%epsilon2
2455 gal21_dest%epsilon3 = gal21_source%epsilon3
2456 gal21_dest%bxy1 = gal21_source%bxy1
2457 gal21_dest%bxy2 = gal21_source%bxy2
2458 gal21_dest%bz1 = gal21_source%bz1
2459 gal21_dest%bz2 = gal21_source%bz2
2460 gal21_dest%r1 = gal21_source%r1
2461 gal21_dest%r2 = gal21_source%r2
2462 gal21_dest%a11 = gal21_source%a11
2463 gal21_dest%a12 = gal21_source%a12
2464 gal21_dest%a13 = gal21_source%a13
2465 gal21_dest%a21 = gal21_source%a21
2466 gal21_dest%a22 = gal21_source%a22
2467 gal21_dest%a23 = gal21_source%a23
2468 gal21_dest%a31 = gal21_source%a31
2469 gal21_dest%a32 = gal21_source%a32
2470 gal21_dest%a33 = gal21_source%a33
2471 gal21_dest%a41 = gal21_source%a41
2472 gal21_dest%a42 = gal21_source%a42
2473 gal21_dest%a43 = gal21_source%a43
2474 gal21_dest%AO1 = gal21_source%AO1
2475 gal21_dest%AO2 = gal21_source%AO2
2476 gal21_dest%BO1 = gal21_source%BO1
2477 gal21_dest%BO2 = gal21_source%BO2
2478 gal21_dest%c = gal21_source%c
2479 gal21_dest%AH1 = gal21_source%AH1
2480 gal21_dest%AH2 = gal21_source%AH2
2481 gal21_dest%BH1 = gal21_source%BH1
2482 gal21_dest%BH2 = gal21_source%BH2
2483 ALLOCATE (gal21_dest%gcn(
SIZE(gal21_source%gcn)))
2484 gal21_dest%gcn = gal21_source%gcn
2485 gal21_dest%express = gal21_source%express
2486 gal21_dest%rcutsq = gal21_source%rcutsq
2488 END SUBROUTINE pair_potential_gal21_copy
2495 SUBROUTINE pair_potential_gal21_clean(gal21)
2498 IF (.NOT.
ASSOCIATED(gal21))
RETURN
2499 gal21%epsilon1 = 0.0_dp
2500 gal21%epsilon2 = 0.0_dp
2501 gal21%epsilon3 = 0.0_dp
2529 gal21%rcutsq = 0.0_dp
2530 gal21%express = .false.
2532 END SUBROUTINE pair_potential_gal21_clean
2539 SUBROUTINE pair_potential_gal21_release(gal21)
2542 IF (
ASSOCIATED(gal21))
THEN
2543 DEALLOCATE (gal21%gcn)
2547 END SUBROUTINE pair_potential_gal21_release
2554 SUBROUTINE pair_potential_tab_create(tab)
2557 cpassert(.NOT.
ASSOCIATED(tab))
2559 NULLIFY (tab%r, tab%e, tab%f)
2560 CALL pair_potential_tab_clean(tab)
2561 END SUBROUTINE pair_potential_tab_create
2568 SUBROUTINE pair_potential_tab_copy(tab_source, tab_dest)
2571 IF (.NOT.
ASSOCIATED(tab_source))
RETURN
2572 IF (
ASSOCIATED(tab_dest))
CALL pair_potential_tab_release(tab_dest)
2573 CALL pair_potential_tab_create(tab_dest)
2574 tab_dest%tabpot_file_name = tab_source%tabpot_file_name
2575 tab_dest%dr = tab_source%dr
2576 tab_dest%rcut = tab_source%rcut
2577 tab_dest%npoints = tab_source%npoints
2578 tab_dest%index = tab_source%index
2580 CALL reallocate(tab_dest%r, 1, tab_dest%npoints)
2581 CALL reallocate(tab_dest%e, 1, tab_dest%npoints)
2582 CALL reallocate(tab_dest%f, 1, tab_dest%npoints)
2583 tab_dest%r = tab_source%r
2584 tab_dest%e = tab_source%e
2585 tab_dest%f = tab_source%f
2586 END SUBROUTINE pair_potential_tab_copy
2592 SUBROUTINE pair_potential_tab_clean(tab)
2595 IF (.NOT.
ASSOCIATED(tab))
RETURN
2596 tab%tabpot_file_name =
'NULL'
2605 END SUBROUTINE pair_potential_tab_clean
2611 SUBROUTINE pair_potential_tab_release(tab)
2614 IF (
ASSOCIATED(tab))
THEN
2615 IF (
ASSOCIATED(tab%r))
THEN
2618 IF (
ASSOCIATED(tab%e))
THEN
2621 IF (
ASSOCIATED(tab%f))
THEN
2626 END SUBROUTINE pair_potential_tab_release
Interface to ACE C wrapper.
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
integer, parameter, public default_path_length
Utility routines for the memory handling.
integer, parameter, public sh_sh
integer, parameter, public nosh_nosh
subroutine, public pair_potential_reallocate(p, lb1_new, ub1_new, lj, lj_charmm, williams, goodwin, eam, nequip, bmhft, bmhftd, ipbv, buck4r, buckmo, gp, tersoff, siepmann, gal, gal21, tab, deepmd, ace)
Cleans the potential parameter type.
integer, parameter, public lj_charmm_type
integer, parameter, public allegro_type
integer, parameter, public bm_type
integer, dimension(22), parameter, public list_pot
integer, parameter, public gal_type
subroutine, public pair_potential_pp_release(potparm)
Release Data-structure that constains potential parameters.
integer, parameter, public nequip_type
integer, parameter, public wl_type
integer, parameter, public ft_type
integer, parameter, public tab_type
integer, parameter, public ftd_type
integer, parameter, public ip_type
subroutine, public pair_potential_p_release(potparm)
Release Data-structure that constains potential parameters.
integer, parameter, public lj_type
integer, parameter, public deepmd_type
subroutine, public pair_potential_single_copy(potparm_source, potparm_dest)
Copy two potential parameter type.
integer, parameter, public nn_type
integer, parameter, public multi_type
integer, parameter, public gp_type
subroutine, public pair_potential_single_add(potparm_source, potparm_dest)
Add potential parameter type to an existing potential parameter type Used in case of multiple_potenti...
integer, parameter, public siepmann_type
integer, parameter, public nosh_sh
subroutine, public pair_potential_single_clean(potparm)
Cleans the potential parameter type.
subroutine, public pair_potential_lj_create(lj)
Cleans the LJ potential type.
integer, parameter, public ace_type
integer, dimension(2), parameter, public do_potential_single_allocation
subroutine, public compare_pot(pot1, pot2, compare)
compare two different potentials
integer, parameter, public gw_type
real(kind=dp), parameter, public not_initialized
subroutine, public pair_potential_pp_create(potparm, nkinds)
Data-structure that constains potential parameters.
integer, dimension(3), parameter, public list_sh_type
integer, dimension(2), parameter, public no_potential_single_allocation
integer, parameter, public mace_type
integer, parameter, public b4_type
integer, parameter, public gal21_type
integer, dimension(2), public potential_single_allocation
integer, parameter, public ea_type
integer, parameter, public tersoff_type
routines for handling splines_types
subroutine, public spline_data_p_copy(spl_p_source, spl_p_dest)
Copy Data-structure of spline_data_p_type.
subroutine, public spline_factor_release(spline_factor)
releases spline_factor
subroutine, public spline_data_p_release(spl_p)
releases spline_data_p
subroutine, public spline_factor_copy(spline_factor_source, spline_factor_dest)
releases spline_factor