27#include "./base/base_uses.f90"
31 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'pair_potential_types'
125 REAL(kind=
dp),
DIMENSION(2:15) :: a = 0.0_dp
126 REAL(kind=
dp) :: rcore = 0.0_dp
127 REAL(kind=
dp) :: m = 0.0_dp
128 REAL(kind=
dp) :: b = 0.0_dp
133 REAL(kind=
dp) :: epsilon = 0.0_dp
134 REAL(kind=
dp) :: sigma6 = 0.0_dp
135 REAL(kind=
dp) :: sigma12 = 0.0_dp
140 REAL(kind=
dp) :: a = 0.0_dp
141 REAL(kind=
dp) :: b = 0.0_dp
142 REAL(kind=
dp) :: c = 0.0_dp
143 REAL(kind=
dp) :: d = 0.0_dp
148 REAL(kind=
dp) :: a = 0.0_dp
149 REAL(kind=
dp) :: b = 0.0_dp
150 REAL(kind=
dp) :: c = 0.0_dp
151 REAL(kind=
dp) :: d = 0.0_dp
152 REAL(kind=
dp),
DIMENSION(2) :: bd = 0.0_dp
153 END TYPE ftd_pot_type
156 TYPE williams_pot_type
157 REAL(kind=
dp) :: a = 0.0_dp
158 REAL(kind=
dp) :: b = 0.0_dp
159 REAL(kind=
dp) :: c = 0.0_dp
160 END TYPE williams_pot_type
163 TYPE goodwin_pot_type
164 REAL(kind=
dp) :: vr0 = 0.0_dp
165 REAL(kind=
dp) :: m = 0.0_dp, mc = 0.0_dp
166 REAL(kind=
dp) :: d = 0.0_dp, dc = 0.0_dp
167 END TYPE goodwin_pot_type
171 CHARACTER(LEN=default_path_length) :: eam_file_name =
""
172 INTEGER :: npoints = 0
173 REAL(kind=
dp) :: drar = 0.0_dp, drhoar = 0.0_dp, acutal = 0.0_dp
174 REAL(kind=
dp),
POINTER,
DIMENSION(:) :: rho => null(), phi => null(), frho => null(), rhoval => null(), rval => null()
175 REAL(kind=
dp),
POINTER,
DIMENSION(:) :: rhop => null(), phip => null(), frhop => null()
180 CHARACTER(LEN=default_path_length) :: ace_file_name =
'NULL'
181 INTEGER :: atom_ace_type = 0
187 CHARACTER(LEN=default_path_length) :: deepmd_file_name =
'NULL'
188 INTEGER :: atom_deepmd_type = 0
193 CHARACTER(LEN=default_path_length) :: pot_file_name =
'NULL', &
194 unit_length =
'NULL', unit_forces =
'NULL', &
196 CHARACTER(LEN=100),
DIMENSION(:),
ALLOCATABLE :: type_names_torch
197 REAL(kind=
dp),
DIMENSION(:, :),
ALLOCATABLE :: cutoff_matrix
198 INTEGER :: num_types = 0
199 REAL(kind=
dp) :: rcutsq = 0.0_dp, unit_length_val = 1.0_dp, &
200 unit_forces_val = 1.0_dp, unit_energy_val = 1.0_dp
201 LOGICAL :: mixed_precision = .false.
205 TYPE buck4ran_pot_type
206 REAL(kind=
dp) :: a = 0.0_dp
207 REAL(kind=
dp) :: b = 0.0_dp
208 REAL(kind=
dp) :: c = 0.0_dp
209 REAL(kind=
dp) :: r1 = 0.0_dp
210 REAL(kind=
dp) :: r2 = 0.0_dp
211 REAL(kind=
dp) :: r3 = 0.0_dp
212 INTEGER :: npoly1 = 0, npoly2 = 0
213 REAL(kind=
dp),
DIMENSION(0:10) :: poly1 = 0.0_dp
214 REAL(kind=
dp),
DIMENSION(0:10) :: poly2 = 0.0_dp
215 END TYPE buck4ran_pot_type
218 TYPE buckmorse_pot_type
219 REAL(kind=
dp) :: f0 = 0.0_dp
220 REAL(kind=
dp) :: a1 = 0.0_dp
221 REAL(kind=
dp) :: a2 = 0.0_dp
222 REAL(kind=
dp) :: b1 = 0.0_dp
223 REAL(kind=
dp) :: b2 = 0.0_dp
224 REAL(kind=
dp) :: c = 0.0_dp
225 REAL(kind=
dp) :: d = 0.0_dp
226 REAL(kind=
dp) :: r0 = 0.0_dp
227 REAL(kind=
dp) :: beta = 0.0_dp
228 END TYPE buckmorse_pot_type
233 CHARACTER(LEN=default_path_length) :: potential =
""
234 CHARACTER(LEN=default_string_length), &
235 POINTER,
DIMENSION(:) :: parameters => null(), units => null()
236 CHARACTER(LEN=default_string_length) :: variables =
""
237 REAL(kind=
dp),
DIMENSION(:),
POINTER :: values => null()
243 REAL(kind=
dp) :: a = 0.0_dp
244 REAL(kind=
dp) :: b = 0.0_dp
245 REAL(kind=
dp) :: lambda1 = 0.0_dp
246 REAL(kind=
dp) :: lambda2 = 0.0_dp
247 REAL(kind=
dp) :: alpha = 0.0_dp
248 REAL(kind=
dp) :: beta = 0.0_dp
249 REAL(kind=
dp) :: n = 0.0_dp
250 REAL(kind=
dp) :: c = 0.0_dp
251 REAL(kind=
dp) :: d = 0.0_dp
252 REAL(kind=
dp) :: h = 0.0_dp
253 REAL(kind=
dp) :: lambda3 = 0.0_dp
254 REAL(kind=
dp) :: bigr = 0.0_dp
255 REAL(kind=
dp) :: bigd = 0.0_dp
256 REAL(kind=
dp) :: rcutsq = 0.0_dp
261 REAL(kind=
dp) :: b = 0.0_dp
262 REAL(kind=
dp) :: d = 0.0_dp
263 REAL(kind=
dp) :: e = 0.0_dp
264 REAL(kind=
dp) :: f = 0.0_dp
265 REAL(kind=
dp) :: beta = 0.0_dp
266 REAL(kind=
dp) :: rcutsq = 0.0_dp
267 LOGICAL :: allow_oh_formation = .false.
268 LOGICAL :: allow_h3o_formation = .false.
269 LOGICAL :: allow_o_formation = .false.
274 CHARACTER(LEN=2) :: met1 =
""
275 CHARACTER(LEN=2) :: met2 =
""
276 REAL(kind=
dp) :: epsilon = 0.0_dp
277 REAL(kind=
dp) :: bxy = 0.0_dp
278 REAL(kind=
dp) :: bz = 0.0_dp
279 REAL(kind=
dp) :: r1 = 0.0_dp
280 REAL(kind=
dp) :: r2 = 0.0_dp
281 REAL(kind=
dp) :: a1 = 0.0_dp
282 REAL(kind=
dp) :: a2 = 0.0_dp
283 REAL(kind=
dp) :: a3 = 0.0_dp
284 REAL(kind=
dp) :: a4 = 0.0_dp
285 REAL(kind=
dp) :: a = 0.0_dp
286 REAL(kind=
dp) :: b = 0.0_dp
287 REAL(kind=
dp) :: c = 0.0_dp
288 REAL(kind=
dp),
POINTER,
DIMENSION(:) :: gcn => null()
289 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: n_vectors
290 REAL(kind=
dp) :: rcutsq = 0.0_dp
291 LOGICAL :: express = .false.
297 CHARACTER(LEN=2) :: met1 =
""
298 CHARACTER(LEN=2) :: met2 =
""
299 REAL(kind=
dp) :: epsilon1 = 0.0_dp
300 REAL(kind=
dp) :: epsilon2 = 0.0_dp
301 REAL(kind=
dp) :: epsilon3 = 0.0_dp
302 REAL(kind=
dp) :: bxy1 = 0.0_dp
303 REAL(kind=
dp) :: bxy2 = 0.0_dp
304 REAL(kind=
dp) :: bz1 = 0.0_dp
305 REAL(kind=
dp) :: bz2 = 0.0_dp
306 REAL(kind=
dp) :: r1 = 0.0_dp
307 REAL(kind=
dp) :: r2 = 0.0_dp
308 REAL(kind=
dp) :: a11 = 0.0_dp
309 REAL(kind=
dp) :: a12 = 0.0_dp
310 REAL(kind=
dp) :: a13 = 0.0_dp
311 REAL(kind=
dp) :: a21 = 0.0_dp
312 REAL(kind=
dp) :: a22 = 0.0_dp
313 REAL(kind=
dp) :: a23 = 0.0_dp
314 REAL(kind=
dp) :: a31 = 0.0_dp
315 REAL(kind=
dp) :: a32 = 0.0_dp
316 REAL(kind=
dp) :: a33 = 0.0_dp
317 REAL(kind=
dp) :: a41 = 0.0_dp
318 REAL(kind=
dp) :: a42 = 0.0_dp
319 REAL(kind=
dp) :: a43 = 0.0_dp
320 REAL(kind=
dp) :: ao1 = 0.0_dp
321 REAL(kind=
dp) :: ao2 = 0.0_dp
322 REAL(kind=
dp) :: bo1 = 0.0_dp
323 REAL(kind=
dp) :: bo2 = 0.0_dp
324 REAL(kind=
dp) :: c = 0.0_dp
325 REAL(kind=
dp) :: ah1 = 0.0_dp
326 REAL(kind=
dp) :: ah2 = 0.0_dp
327 REAL(kind=
dp) :: bh1 = 0.0_dp
328 REAL(kind=
dp) :: bh2 = 0.0_dp
329 REAL(kind=
dp),
POINTER,
DIMENSION(:) :: gcn => null()
330 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: n_vectors
331 REAL(kind=
dp) :: rcutsq = 0.0_dp
332 LOGICAL :: express = .false.
338 CHARACTER(LEN=default_path_length) :: tabpot_file_name =
""
339 INTEGER :: npoints = 0, index = 0
340 REAL(kind=
dp) :: dr = 0.0_dp, rcut = 0.0_dp
341 REAL(kind=
dp),
POINTER,
DIMENSION(:) :: r => null(), e => null(), f => null()
347 REAL(kind=
dp) :: rmin = 0.0_dp, rmax = 0.0_dp
349 TYPE(gp_pot_type),
POINTER :: gp => null()
350 TYPE(lj_pot_type),
POINTER :: lj => null()
352 TYPE(williams_pot_type),
POINTER :: willis => null()
353 TYPE(goodwin_pot_type),
POINTER :: goodwin => null()
358 TYPE(buck4ran_pot_type),
POINTER :: buck4r => null()
359 TYPE(buckmorse_pot_type),
POINTER :: buckmo => null()
364 TYPE(ftd_pot_type),
POINTER :: ftd => null()
366 END TYPE pot_set_type
370 REAL(kind=
dp) :: rcutsq = 0.0_dp
371 REAL(kind=
dp) :: e_fac = 0.0_dp
372 REAL(kind=
dp) :: e_fcc = 0.0_dp
373 REAL(kind=
dp) :: e_fcs = 0.0_dp
374 REAL(kind=
dp) :: e_fsc = 0.0_dp
375 REAL(kind=
dp) :: z1 = 0.0_dp
376 REAL(kind=
dp) :: z2 = 0.0_dp
377 REAL(kind=
dp),
DIMENSION(0:5) :: zbl_poly = 0.0_dp
378 REAL(kind=
dp),
DIMENSION(2) :: zbl_rcut = 0.0_dp
379 LOGICAL :: undef = .false., &
382 INTEGER :: shell_type = 0
383 CHARACTER(LEN=default_string_length) :: at1 =
""
384 CHARACTER(LEN=default_string_length) :: at2 =
""
385 INTEGER,
POINTER,
DIMENSION(:) ::
TYPE => null()
386 TYPE(pot_set_type),
POINTER,
DIMENSION(:) :: set => null()
392 TYPE pair_potential_type
394 END TYPE pair_potential_type
398 TYPE(pair_potential_type),
DIMENSION(:),
POINTER :: pot => null()
403 TYPE(pair_potential_type),
DIMENSION(:, :),
POINTER :: pot => null()
417 LOGICAL,
INTENT(OUT) :: compare
425 cpassert(
ASSOCIATED(pot1%type))
426 cpassert(
ASSOCIATED(pot2%type))
427 IF (
SIZE(pot1%type) /=
SIZE(pot2%type))
RETURN
428 IF (any(pot1%type /= pot2%type))
RETURN
431 cpassert(
ASSOCIATED(pot1%set))
432 cpassert(
ASSOCIATED(pot2%set))
433 DO i = 1,
SIZE(pot1%type)
435 SELECT CASE (pot1%type(i))
437 IF ((pot1%set(i)%lj%epsilon == pot2%set(i)%lj%epsilon) .AND. &
438 (pot1%set(i)%lj%sigma6 == pot2%set(i)%lj%sigma6) .AND. &
439 (pot1%set(i)%lj%sigma12 == pot2%set(i)%lj%sigma12)) mycompare = .true.
441 IF ((pot1%set(i)%willis%a == pot2%set(i)%willis%a) .AND. &
442 (pot1%set(i)%willis%b == pot2%set(i)%willis%b) .AND. &
443 (pot1%set(i)%willis%c == pot2%set(i)%willis%c)) mycompare = .true.
445 IF ((pot1%set(i)%goodwin%vr0 == pot2%set(i)%goodwin%vr0) .AND. &
446 (pot1%set(i)%goodwin%m == pot2%set(i)%goodwin%m) .AND. &
447 (pot1%set(i)%goodwin%mc == pot2%set(i)%goodwin%mc) .AND. &
448 (pot1%set(i)%goodwin%d == pot2%set(i)%goodwin%d) .AND. &
449 (pot1%set(i)%goodwin%dc == pot2%set(i)%goodwin%dc)) mycompare = .true.
452 IF (pot1%set(i)%eam%npoints == pot2%set(i)%eam%npoints)
THEN
453 IF ((pot1%set(i)%eam%drar == pot2%set(i)%eam%drar) .AND. &
454 (pot1%set(i)%eam%drhoar == pot2%set(i)%eam%drhoar) .AND. &
455 (pot1%set(i)%eam%acutal == pot2%set(i)%eam%acutal) .AND. &
456 (sum(abs(pot1%set(i)%eam%rho - pot2%set(i)%eam%rho)) == 0.0_dp) .AND. &
457 (sum(abs(pot1%set(i)%eam%phi - pot2%set(i)%eam%phi)) == 0.0_dp) .AND. &
458 (sum(abs(pot1%set(i)%eam%frho - pot2%set(i)%eam%frho)) == 0.0_dp) .AND. &
459 (sum(abs(pot1%set(i)%eam%rhoval - pot2%set(i)%eam%rhoval)) == 0.0_dp) .AND. &
460 (sum(abs(pot1%set(i)%eam%rval - pot2%set(i)%eam%rval)) == 0.0_dp) .AND. &
461 (sum(abs(pot1%set(i)%eam%rhop - pot2%set(i)%eam%rhop)) == 0.0_dp) .AND. &
462 (sum(abs(pot1%set(i)%eam%phip - pot2%set(i)%eam%phip)) == 0.0_dp) .AND. &
463 (sum(abs(pot1%set(i)%eam%frhop - pot2%set(i)%eam%frhop)) == 0.0_dp)) mycompare = .true.
466 IF ((pot1%set(i)%ace%ace_file_name == pot2%set(i)%ace%ace_file_name) .AND. &
467 (pot1%set(i)%ace%atom_ace_type == pot2%set(i)%ace%atom_ace_type)) mycompare = .true.
469 IF ((pot1%set(i)%deepmd%deepmd_file_name == pot2%set(i)%deepmd%deepmd_file_name) .AND. &
470 (pot1%set(i)%deepmd%atom_deepmd_type == pot2%set(i)%deepmd%atom_deepmd_type)) mycompare = .true.
472 IF ((pot1%set(i)%nequip%pot_file_name == pot2%set(i)%nequip%pot_file_name) .AND. &
473 (pot1%set(i)%nequip%unit_length == pot2%set(i)%nequip%unit_length) .AND. &
474 (pot1%set(i)%nequip%unit_forces == pot2%set(i)%nequip%unit_forces) .AND. &
475 (pot1%set(i)%nequip%unit_energy == pot2%set(i)%nequip%unit_energy)) mycompare = .true.
477 IF ((pot1%set(i)%ft%A == pot2%set(i)%ft%A) .AND. &
478 (pot1%set(i)%ft%B == pot2%set(i)%ft%B) .AND. &
479 (pot1%set(i)%ft%C == pot2%set(i)%ft%C) .AND. &
480 (pot1%set(i)%ft%D == pot2%set(i)%ft%D)) mycompare = .true.
482 IF ((pot1%set(i)%ftd%A == pot2%set(i)%ftd%A) .AND. &
483 (pot1%set(i)%ftd%B == pot2%set(i)%ftd%B) .AND. &
484 (pot1%set(i)%ftd%C == pot2%set(i)%ftd%C) .AND. &
485 (pot1%set(i)%ftd%D == pot2%set(i)%ftd%D) .AND. &
486 (all(pot1%set(i)%ftd%BD(:) == pot2%set(i)%ftd%BD(:)))) mycompare = .true.
488 IF ((sum(abs(pot1%set(i)%ipbv%a - pot2%set(i)%ipbv%a)) == 0.0_dp) .AND. &
489 (pot1%set(i)%ipbv%rcore == pot2%set(i)%ipbv%rcore) .AND. &
490 (pot1%set(i)%ipbv%m == pot2%set(i)%ipbv%m) .AND. &
491 (pot1%set(i)%ipbv%b == pot2%set(i)%ipbv%b)) mycompare = .true.
493 IF ((pot1%set(i)%tersoff%A == pot2%set(i)%tersoff%A) .AND. &
494 (pot1%set(i)%tersoff%B == pot2%set(i)%tersoff%B) .AND. &
495 (pot1%set(i)%tersoff%lambda1 == pot2%set(i)%tersoff%lambda1) .AND. &
496 (pot1%set(i)%tersoff%lambda2 == pot2%set(i)%tersoff%lambda2) .AND. &
497 (pot1%set(i)%tersoff%alpha == pot2%set(i)%tersoff%alpha) .AND. &
498 (pot1%set(i)%tersoff%beta == pot2%set(i)%tersoff%beta) .AND. &
499 (pot1%set(i)%tersoff%n == pot2%set(i)%tersoff%n) .AND. &
500 (pot1%set(i)%tersoff%c == pot2%set(i)%tersoff%c) .AND. &
501 (pot1%set(i)%tersoff%d == pot2%set(i)%tersoff%d) .AND. &
502 (pot1%set(i)%tersoff%h == pot2%set(i)%tersoff%h) .AND. &
503 (pot1%set(i)%tersoff%lambda3 == pot2%set(i)%tersoff%lambda3) .AND. &
504 (pot1%set(i)%tersoff%rcutsq == pot2%set(i)%tersoff%rcutsq) .AND. &
505 (pot1%set(i)%tersoff%bigR == pot2%set(i)%tersoff%bigR) .AND. &
506 (pot1%set(i)%tersoff%bigD == pot2%set(i)%tersoff%bigD)) mycompare = .true.
508 IF ((pot1%set(i)%siepmann%B == pot2%set(i)%siepmann%B) .AND. &
509 (pot1%set(i)%siepmann%D == pot2%set(i)%siepmann%D) .AND. &
510 (pot1%set(i)%siepmann%E == pot2%set(i)%siepmann%E) .AND. &
511 (pot1%set(i)%siepmann%F == pot2%set(i)%siepmann%F) .AND. &
512 (pot1%set(i)%siepmann%beta == pot2%set(i)%siepmann%beta) .AND. &
513 (pot1%set(i)%siepmann%rcutsq == pot2%set(i)%siepmann%rcutsq) .AND. &
514 (pot1%set(i)%siepmann%allow_oh_formation .EQV. &
515 pot2%set(i)%siepmann%allow_oh_formation) .AND. &
516 (pot1%set(i)%siepmann%allow_o_formation .EQV. &
517 pot2%set(i)%siepmann%allow_o_formation) .AND. &
518 (pot1%set(i)%siepmann%allow_h3o_formation .EQV. &
519 pot2%set(i)%siepmann%allow_h3o_formation)) mycompare = .true.
521 IF ((pot1%set(i)%gal%epsilon == pot2%set(i)%gal%epsilon) .AND. &
522 (pot1%set(i)%gal%bxy == pot2%set(i)%gal%bxy) .AND. &
523 (pot1%set(i)%gal%bz == pot2%set(i)%gal%bz) .AND. &
524 (pot1%set(i)%gal%r1 == pot2%set(i)%gal%r1) .AND. &
525 (pot1%set(i)%gal%r2 == pot2%set(i)%gal%r2) .AND. &
526 (pot1%set(i)%gal%a1 == pot2%set(i)%gal%a1) .AND. &
527 (pot1%set(i)%gal%a2 == pot2%set(i)%gal%a2) .AND. &
528 (pot1%set(i)%gal%a3 == pot2%set(i)%gal%a3) .AND. &
529 (pot1%set(i)%gal%a4 == pot2%set(i)%gal%a4) .AND. &
530 (pot1%set(i)%gal%a == pot2%set(i)%gal%a) .AND. &
531 (pot1%set(i)%gal%b == pot2%set(i)%gal%b) .AND. &
532 (pot1%set(i)%gal%c == pot2%set(i)%gal%c) .AND. &
533 (pot1%set(i)%gal%express .EQV. &
534 pot2%set(i)%gal%express) .AND. &
535 (pot1%set(i)%gal%rcutsq == pot2%set(i)%gal%rcutsq)) mycompare = .true.
537 IF ((pot1%set(i)%gal21%epsilon1 == pot2%set(i)%gal21%epsilon1) .AND. &
538 (pot1%set(i)%gal21%epsilon2 == pot2%set(i)%gal21%epsilon2) .AND. &
539 (pot1%set(i)%gal21%epsilon3 == pot2%set(i)%gal21%epsilon3) .AND. &
540 (pot1%set(i)%gal21%bxy1 == pot2%set(i)%gal21%bxy1) .AND. &
541 (pot1%set(i)%gal21%bxy2 == pot2%set(i)%gal21%bxy1) .AND. &
542 (pot1%set(i)%gal21%bz1 == pot2%set(i)%gal21%bz1) .AND. &
543 (pot1%set(i)%gal21%bz2 == pot2%set(i)%gal21%bz2) .AND. &
544 (pot1%set(i)%gal21%r1 == pot2%set(i)%gal21%r1) .AND. &
545 (pot1%set(i)%gal21%r2 == pot2%set(i)%gal21%r2) .AND. &
546 (pot1%set(i)%gal21%a11 == pot2%set(i)%gal21%a11) .AND. &
547 (pot1%set(i)%gal21%a12 == pot2%set(i)%gal21%a12) .AND. &
548 (pot1%set(i)%gal21%a13 == pot2%set(i)%gal21%a13) .AND. &
549 (pot1%set(i)%gal21%a21 == pot2%set(i)%gal21%a21) .AND. &
550 (pot1%set(i)%gal21%a22 == pot2%set(i)%gal21%a22) .AND. &
551 (pot1%set(i)%gal21%a23 == pot2%set(i)%gal21%a23) .AND. &
552 (pot1%set(i)%gal21%a31 == pot2%set(i)%gal21%a31) .AND. &
553 (pot1%set(i)%gal21%a32 == pot2%set(i)%gal21%a32) .AND. &
554 (pot1%set(i)%gal21%a33 == pot2%set(i)%gal21%a33) .AND. &
555 (pot1%set(i)%gal21%a41 == pot2%set(i)%gal21%a41) .AND. &
556 (pot1%set(i)%gal21%a42 == pot2%set(i)%gal21%a42) .AND. &
557 (pot1%set(i)%gal21%a43 == pot2%set(i)%gal21%a43) .AND. &
558 (pot1%set(i)%gal21%AO1 == pot2%set(i)%gal21%AO1) .AND. &
559 (pot1%set(i)%gal21%AO2 == pot2%set(i)%gal21%AO2) .AND. &
560 (pot1%set(i)%gal21%BO1 == pot2%set(i)%gal21%BO1) .AND. &
561 (pot1%set(i)%gal21%BO2 == pot2%set(i)%gal21%BO2) .AND. &
562 (pot1%set(i)%gal21%c == pot2%set(i)%gal21%c) .AND. &
563 (pot1%set(i)%gal21%AH1 == pot2%set(i)%gal21%AH1) .AND. &
564 (pot1%set(i)%gal21%AH2 == pot2%set(i)%gal21%AH2) .AND. &
565 (pot1%set(i)%gal21%BH1 == pot2%set(i)%gal21%BH1) .AND. &
566 (pot1%set(i)%gal21%BH2 == pot2%set(i)%gal21%BH2) .AND. &
567 (pot1%set(i)%gal21%express .EQV. &
568 pot2%set(i)%gal21%express) .AND. &
569 (pot1%set(i)%gal21%rcutsq == pot2%set(i)%gal21%rcutsq)) mycompare = .true.
572 mycompare = mycompare .AND. &
573 (pot1%set(i)%rmin == pot2%set(i)%rmin) .AND. (pot1%set(i)%rmax == pot2%set(i)%rmax)
574 IF ((mycompare) .AND. (i == 1)) compare = .true.
575 compare = compare .AND. mycompare
586 SUBROUTINE pair_potential_single_create(potparm, nset)
588 INTEGER,
INTENT(IN),
OPTIONAL :: nset
592 cpassert(.NOT.
ASSOCIATED(potparm))
595 IF (
PRESENT(nset)) lnset = nset
597 ALLOCATE (potparm%type(lnset))
598 ALLOCATE (potparm%set(lnset))
599 NULLIFY (potparm%spl_f, &
600 potparm%pair_spline_data)
604 NULLIFY (potparm%set(i)%ipbv, &
608 potparm%set(i)%willis, &
609 potparm%set(i)%goodwin, &
610 potparm%set(i)%eam, &
611 potparm%set(i)%nequip, &
612 potparm%set(i)%ace, &
613 potparm%set(i)%deepmd, &
614 potparm%set(i)%buck4r, &
615 potparm%set(i)%buckmo, &
616 potparm%set(i)%tersoff, &
617 potparm%set(i)%siepmann, &
618 potparm%set(i)%gal, &
619 potparm%set(i)%gal21, &
620 potparm%set(i)%ftd, &
624 END SUBROUTINE pair_potential_single_create
638 potparm%undef = .true.
639 potparm%no_pp = .false.
640 potparm%no_mb = .false.
643 potparm%rcutsq = 0.0_dp
644 IF (
ASSOCIATED(potparm%pair_spline_data)) &
646 IF (
ASSOCIATED(potparm%spl_f)) &
649 DO i = 1,
SIZE(potparm%type)
652 CALL pair_potential_lj_clean(potparm%set(i)%lj)
653 CALL pair_potential_williams_clean(potparm%set(i)%willis)
654 CALL pair_potential_goodwin_clean(potparm%set(i)%goodwin)
655 CALL pair_potential_eam_clean(potparm%set(i)%eam)
656 CALL pair_potential_nequip_clean(potparm%set(i)%nequip)
657 CALL pair_potential_ace_clean(potparm%set(i)%ace)
658 CALL pair_potential_deepmd_clean(potparm%set(i)%deepmd)
659 CALL pair_potential_buck4r_clean(potparm%set(i)%buck4r)
660 CALL pair_potential_buckmo_clean(potparm%set(i)%buckmo)
661 CALL pair_potential_bmhft_clean(potparm%set(i)%ft)
662 CALL pair_potential_bmhftd_clean(potparm%set(i)%ftd)
663 CALL pair_potential_ipbv_clean(potparm%set(i)%ipbv)
664 CALL pair_potential_gp_clean(potparm%set(i)%gp)
665 CALL pair_potential_tersoff_clean(potparm%set(i)%tersoff)
666 CALL pair_potential_siepmann_clean(potparm%set(i)%siepmann)
667 CALL pair_potential_gal_clean(potparm%set(i)%gal)
668 CALL pair_potential_gal21_clean(potparm%set(i)%gal21)
669 CALL pair_potential_tab_clean(potparm%set(i)%tab)
684 cpassert(
ASSOCIATED(potparm_source))
685 IF (.NOT.
ASSOCIATED(potparm_dest))
THEN
686 CALL pair_potential_single_create(potparm_dest,
SIZE(potparm_source%type))
690 potparm_dest%type = potparm_source%type
691 potparm_dest%shell_type = potparm_source%shell_type
692 potparm_dest%undef = potparm_source%undef
693 potparm_dest%no_mb = potparm_source%no_mb
694 potparm_dest%no_pp = potparm_source%no_pp
695 potparm_dest%at1 = potparm_source%at1
696 potparm_dest%at2 = potparm_source%at2
697 potparm_dest%rcutsq = potparm_source%rcutsq
698 IF (
ASSOCIATED(potparm_source%pair_spline_data))
THEN
699 CALL spline_data_p_copy(potparm_source%pair_spline_data, potparm_dest%pair_spline_data)
702 IF (
ASSOCIATED(potparm_source%spl_f))
THEN
706 DO i = 1,
SIZE(potparm_source%type)
707 potparm_dest%set(i)%rmin = potparm_source%set(i)%rmin
708 potparm_dest%set(i)%rmax = potparm_source%set(i)%rmax
709 CALL pair_potential_lj_copy(potparm_source%set(i)%lj, potparm_dest%set(i)%lj)
710 CALL pair_potential_williams_copy(potparm_source%set(i)%willis, potparm_dest%set(i)%willis)
711 CALL pair_potential_goodwin_copy(potparm_source%set(i)%goodwin, potparm_dest%set(i)%goodwin)
712 CALL pair_potential_eam_copy(potparm_source%set(i)%eam, potparm_dest%set(i)%eam)
713 CALL pair_potential_nequip_copy(potparm_source%set(i)%nequip, potparm_dest%set(i)%nequip)
714 CALL pair_potential_ace_copy(potparm_source%set(i)%ace, potparm_dest%set(i)%ace)
715 CALL pair_potential_deepmd_copy(potparm_source%set(i)%deepmd, potparm_dest%set(i)%deepmd)
716 CALL pair_potential_bmhft_copy(potparm_source%set(i)%ft, potparm_dest%set(i)%ft)
717 CALL pair_potential_bmhftd_copy(potparm_source%set(i)%ftd, potparm_dest%set(i)%ftd)
718 CALL pair_potential_ipbv_copy(potparm_source%set(i)%ipbv, potparm_dest%set(i)%ipbv)
719 CALL pair_potential_buck4r_copy(potparm_source%set(i)%buck4r, potparm_dest%set(i)%buck4r)
720 CALL pair_potential_buckmo_copy(potparm_source%set(i)%buckmo, potparm_dest%set(i)%buckmo)
721 CALL pair_potential_gp_copy(potparm_source%set(i)%gp, potparm_dest%set(i)%gp)
722 CALL pair_potential_tersoff_copy(potparm_source%set(i)%tersoff, potparm_dest%set(i)%tersoff)
723 CALL pair_potential_siepmann_copy(potparm_source%set(i)%siepmann, potparm_dest%set(i)%siepmann)
724 CALL pair_potential_gal_copy(potparm_source%set(i)%gal, potparm_dest%set(i)%gal)
725 CALL pair_potential_gal21_copy(potparm_source%set(i)%gal21, potparm_dest%set(i)%gal21)
726 CALL pair_potential_tab_copy(potparm_source%set(i)%tab, potparm_dest%set(i)%tab)
740 INTEGER :: i, j, size_dest, size_source
741 LOGICAL :: allocate_new, check
744 cpassert(
ASSOCIATED(potparm_source))
747 check = (.NOT.
ASSOCIATED(potparm_source%pair_spline_data)) .AND. &
748 (.NOT.
ASSOCIATED(potparm_source%spl_f))
750 check = (.NOT.
ASSOCIATED(potparm_dest%pair_spline_data)) .AND. &
751 (.NOT.
ASSOCIATED(potparm_dest%spl_f))
754 size_source =
SIZE(potparm_source%type)
755 allocate_new = .NOT.
ASSOCIATED(potparm_dest)
756 IF (.NOT. allocate_new)
THEN
757 size_dest =
SIZE(potparm_dest%type)
758 IF (size_dest == 1)
THEN
759 check = (
ASSOCIATED(potparm_dest%set(1)%lj)) .OR. &
760 (
ASSOCIATED(potparm_dest%set(1)%willis)) .OR. &
761 (
ASSOCIATED(potparm_dest%set(1)%goodwin)) .OR. &
762 (
ASSOCIATED(potparm_dest%set(1)%eam)) .OR. &
763 (
ASSOCIATED(potparm_dest%set(1)%nequip)) .OR. &
764 (
ASSOCIATED(potparm_dest%set(1)%ace)) .OR. &
765 (
ASSOCIATED(potparm_dest%set(1)%deepmd)) .OR. &
766 (
ASSOCIATED(potparm_dest%set(1)%ft)) .OR. &
767 (
ASSOCIATED(potparm_dest%set(1)%ftd)) .OR. &
768 (
ASSOCIATED(potparm_dest%set(1)%ipbv)) .OR. &
769 (
ASSOCIATED(potparm_dest%set(1)%buck4r)) .OR. &
770 (
ASSOCIATED(potparm_dest%set(1)%buckmo)) .OR. &
771 (
ASSOCIATED(potparm_dest%set(1)%gp)) .OR. &
772 (
ASSOCIATED(potparm_dest%set(1)%tersoff)) .OR. &
773 (
ASSOCIATED(potparm_dest%set(1)%siepmann)) .OR. &
774 (
ASSOCIATED(potparm_dest%set(1)%gal)) .OR. &
775 (
ASSOCIATED(potparm_dest%set(1)%gal)) .OR. &
776 (
ASSOCIATED(potparm_dest%set(1)%tab))
777 IF (.NOT. check)
THEN
778 allocate_new = .true.
779 CALL pair_potential_single_release(potparm_dest)
783 IF (allocate_new)
THEN
785 CALL pair_potential_single_create(potparm_dest, size_source)
786 potparm_dest%shell_type = potparm_source%shell_type
787 potparm_dest%undef = potparm_source%undef
788 potparm_dest%no_mb = potparm_source%no_mb
789 potparm_dest%no_pp = potparm_source%no_pp
790 potparm_dest%at1 = potparm_source%at1
791 potparm_dest%at2 = potparm_source%at2
792 potparm_dest%rcutsq = potparm_source%rcutsq
794 size_dest =
SIZE(potparm_dest%type)
795 NULLIFY (potparm_tmp)
797 CALL pair_potential_single_release(potparm_dest)
798 CALL pair_potential_single_create(potparm_dest, size_dest + size_source)
800 potparm_dest%shell_type = potparm_tmp%shell_type
801 potparm_dest%undef = potparm_tmp%undef
802 potparm_dest%no_mb = potparm_tmp%no_mb
803 potparm_dest%no_pp = potparm_tmp%no_pp
804 potparm_dest%at1 = potparm_tmp%at1
805 potparm_dest%at2 = potparm_tmp%at2
806 potparm_dest%rcutsq = potparm_tmp%rcutsq
808 potparm_dest%type(i) = potparm_tmp%type(i)
809 potparm_dest%set(i)%rmin = potparm_tmp%set(i)%rmin
810 potparm_dest%set(i)%rmax = potparm_tmp%set(i)%rmax
811 CALL pair_potential_lj_copy(potparm_tmp%set(i)%lj, potparm_dest%set(i)%lj)
812 CALL pair_potential_williams_copy(potparm_tmp%set(i)%willis, potparm_dest%set(i)%willis)
813 CALL pair_potential_goodwin_copy(potparm_tmp%set(i)%goodwin, potparm_dest%set(i)%goodwin)
814 CALL pair_potential_eam_copy(potparm_tmp%set(i)%eam, potparm_dest%set(i)%eam)
815 CALL pair_potential_nequip_copy(potparm_tmp%set(i)%nequip, potparm_dest%set(i)%nequip)
816 CALL pair_potential_ace_copy(potparm_tmp%set(i)%ace, potparm_dest%set(i)%ace)
817 CALL pair_potential_deepmd_copy(potparm_tmp%set(i)%deepmd, potparm_dest%set(i)%deepmd)
818 CALL pair_potential_bmhft_copy(potparm_tmp%set(i)%ft, potparm_dest%set(i)%ft)
819 CALL pair_potential_bmhftd_copy(potparm_tmp%set(i)%ftd, potparm_dest%set(i)%ftd)
820 CALL pair_potential_ipbv_copy(potparm_tmp%set(i)%ipbv, potparm_dest%set(i)%ipbv)
821 CALL pair_potential_buck4r_copy(potparm_tmp%set(i)%buck4r, potparm_dest%set(i)%buck4r)
822 CALL pair_potential_buckmo_copy(potparm_tmp%set(i)%buckmo, potparm_dest%set(i)%buckmo)
823 CALL pair_potential_gp_copy(potparm_tmp%set(i)%gp, potparm_dest%set(i)%gp)
824 CALL pair_potential_tersoff_copy(potparm_tmp%set(i)%tersoff, potparm_dest%set(i)%tersoff)
825 CALL pair_potential_siepmann_copy(potparm_tmp%set(i)%siepmann, potparm_dest%set(i)%siepmann)
826 CALL pair_potential_gal_copy(potparm_tmp%set(i)%gal, potparm_dest%set(i)%gal)
827 CALL pair_potential_gal21_copy(potparm_tmp%set(i)%gal21, potparm_dest%set(i)%gal21)
828 CALL pair_potential_tab_copy(potparm_tmp%set(i)%tab, potparm_dest%set(i)%tab)
830 CALL pair_potential_single_release(potparm_tmp)
833 check = (potparm_dest%shell_type == potparm_source%shell_type) .AND. &
834 (potparm_dest%undef .EQV. potparm_source%undef) .AND. &
835 (potparm_dest%no_mb .EQV. potparm_source%no_mb) .AND. &
836 (potparm_dest%no_pp .EQV. potparm_source%no_pp) .AND. &
837 (potparm_dest%at1 == potparm_source%at1) .AND. &
838 (potparm_dest%at2 == potparm_source%at2) .AND. &
839 (potparm_dest%rcutsq == potparm_source%rcutsq)
842 DO i = size_dest + 1, size_dest + size_source
844 potparm_dest%type(i) = potparm_source%type(j)
845 potparm_dest%set(i)%rmin = potparm_source%set(j)%rmin
846 potparm_dest%set(i)%rmax = potparm_source%set(j)%rmax
847 CALL pair_potential_lj_copy(potparm_source%set(j)%lj, potparm_dest%set(i)%lj)
848 CALL pair_potential_williams_copy(potparm_source%set(j)%willis, potparm_dest%set(i)%willis)
849 CALL pair_potential_goodwin_copy(potparm_source%set(j)%goodwin, potparm_dest%set(i)%goodwin)
850 CALL pair_potential_eam_copy(potparm_source%set(j)%eam, potparm_dest%set(i)%eam)
851 CALL pair_potential_nequip_copy(potparm_source%set(j)%nequip, potparm_dest%set(i)%nequip)
852 CALL pair_potential_ace_copy(potparm_source%set(j)%ace, potparm_dest%set(i)%ace)
853 CALL pair_potential_deepmd_copy(potparm_source%set(j)%deepmd, potparm_dest%set(i)%deepmd)
854 CALL pair_potential_bmhft_copy(potparm_source%set(j)%ft, potparm_dest%set(i)%ft)
855 CALL pair_potential_bmhftd_copy(potparm_source%set(j)%ftd, potparm_dest%set(i)%ftd)
856 CALL pair_potential_ipbv_copy(potparm_source%set(j)%ipbv, potparm_dest%set(i)%ipbv)
857 CALL pair_potential_buck4r_copy(potparm_source%set(j)%buck4r, potparm_dest%set(i)%buck4r)
858 CALL pair_potential_buckmo_copy(potparm_source%set(j)%buckmo, potparm_dest%set(i)%buckmo)
859 CALL pair_potential_gp_copy(potparm_source%set(j)%gp, potparm_dest%set(i)%gp)
860 CALL pair_potential_tersoff_copy(potparm_source%set(j)%tersoff, potparm_dest%set(i)%tersoff)
861 CALL pair_potential_siepmann_copy(potparm_source%set(j)%siepmann, potparm_dest%set(i)%siepmann)
862 CALL pair_potential_gal_copy(potparm_source%set(j)%gal, potparm_dest%set(i)%gal)
863 CALL pair_potential_gal21_copy(potparm_source%set(j)%gal21, potparm_dest%set(i)%gal21)
864 CALL pair_potential_tab_copy(potparm_source%set(j)%tab, potparm_dest%set(i)%tab)
873 SUBROUTINE pair_potential_single_release(potparm)
878 cpassert(
ASSOCIATED(potparm))
881 DO i = 1,
SIZE(potparm%type)
882 CALL pair_potential_ipbv_release(potparm%set(i)%ipbv)
883 CALL pair_potential_lj_release(potparm%set(i)%lj)
884 CALL pair_potential_bmhft_release(potparm%set(i)%ft)
885 CALL pair_potential_bmhftd_release(potparm%set(i)%ftd)
886 CALL pair_potential_williams_release(potparm%set(i)%willis)
887 CALL pair_potential_goodwin_release(potparm%set(i)%goodwin)
888 CALL pair_potential_eam_release(potparm%set(i)%eam)
889 CALL pair_potential_nequip_release(potparm%set(i)%nequip)
890 CALL pair_potential_ace_release(potparm%set(i)%ace)
891 CALL pair_potential_deepmd_release(potparm%set(i)%deepmd)
892 CALL pair_potential_buck4r_release(potparm%set(i)%buck4r)
893 CALL pair_potential_buckmo_release(potparm%set(i)%buckmo)
894 CALL pair_potential_gp_release(potparm%set(i)%gp)
895 CALL pair_potential_tersoff_release(potparm%set(i)%tersoff)
896 CALL pair_potential_siepmann_release(potparm%set(i)%siepmann)
897 CALL pair_potential_gal_release(potparm%set(i)%gal)
898 CALL pair_potential_gal21_release(potparm%set(i)%gal21)
899 CALL pair_potential_tab_release(potparm%set(i)%tab)
901 DEALLOCATE (potparm%type)
902 DEALLOCATE (potparm%set)
904 END SUBROUTINE pair_potential_single_release
914 INTEGER,
INTENT(IN) :: nkinds
918 cpassert(.NOT.
ASSOCIATED(potparm))
920 ALLOCATE (potparm%pot(nkinds, nkinds))
923 NULLIFY (potparm%pot(i, j)%pot)
929 CALL pair_potential_single_create(potparm%pot(i, j)%pot)
930 potparm%pot(j, i)%pot => potparm%pot(i, j)%pot
948 IF (
ASSOCIATED(potparm))
THEN
949 IF (
ASSOCIATED(potparm%pot))
THEN
950 DO i = 1,
SIZE(potparm%pot, 1)
951 DO j = i,
SIZE(potparm%pot, 2)
952 CALL pair_potential_single_release(potparm%pot(i, j)%pot)
953 NULLIFY (potparm%pot(j, i)%pot)
956 DEALLOCATE (potparm%pot)
971 SUBROUTINE pair_potential_p_create(potparm, ndim, ub, lb)
973 INTEGER,
INTENT(IN),
OPTIONAL :: ndim, ub, lb
975 INTEGER :: i, loc_lb, loc_ub
977 cpassert(.NOT.
ASSOCIATED(potparm))
979 IF (
PRESENT(ndim))
THEN
982 ALLOCATE (potparm%pot(loc_lb:loc_ub))
983 IF (
PRESENT(lb) .OR.
PRESENT(ub))
THEN
986 ELSE IF (
PRESENT(lb) .AND.
PRESENT(ub))
THEN
989 ALLOCATE (potparm%pot(loc_lb:loc_ub))
990 IF (
PRESENT(ndim))
THEN
996 DO i = loc_lb, loc_ub
997 NULLIFY (potparm%pot(i)%pot)
998 CALL pair_potential_single_create(potparm%pot(i)%pot)
1000 END SUBROUTINE pair_potential_p_create
1015 IF (
ASSOCIATED(potparm))
THEN
1016 IF (
ASSOCIATED(potparm%pot))
THEN
1017 DO i = 1,
SIZE(potparm%pot)
1018 CALL pair_potential_single_release(potparm%pot(i)%pot)
1020 DEALLOCATE (potparm%pot)
1022 DEALLOCATE (potparm)
1035 SUBROUTINE pair_potential_p_copy(source, dest, istart, iend)
1037 INTEGER,
INTENT(IN),
OPTIONAL :: istart, iend
1039 INTEGER :: i, l_end, l_start
1041 cpassert(
ASSOCIATED(source))
1042 cpassert(
ASSOCIATED(dest))
1043 l_start = lbound(source%pot, 1)
1044 l_end = ubound(source%pot, 1)
1045 IF (
PRESENT(istart)) l_start = istart
1046 IF (
PRESENT(iend)) l_end = iend
1047 DO i = l_start, l_end
1048 IF (.NOT.
ASSOCIATED(source%pot(i)%pot)) &
1049 CALL pair_potential_single_create(source%pot(i)%pot)
1052 END SUBROUTINE pair_potential_p_copy
1081 nequip, bmhft, bmhftd, ipbv, buck4r, buckmo, &
1082 gp, tersoff, siepmann, gal, gal21, tab, deepmd, ace)
1084 INTEGER,
INTENT(IN) :: lb1_new, ub1_new
1085 LOGICAL,
INTENT(IN),
OPTIONAL :: lj, lj_charmm, williams, goodwin, eam, nequip, bmhft, &
1086 bmhftd, ipbv, buck4r, buckmo, gp, tersoff, siepmann, gal, gal21, tab, deepmd, ace
1088 INTEGER :: i, ipot, lb1_old, std_dim, ub1_old
1089 LOGICAL :: check, lace, lbmhft, lbmhftd, lbuck4r, lbuckmo, ldeepmd, leam, lgal, lgal21, &
1090 lgoodwin, lgp, lipbv, llj, llj_charmm, lnequip, lsiepmann, ltab, ltersoff, lwilliams
1095 llj = .false.;
IF (
PRESENT(lj)) llj = lj
1096 llj_charmm = .false.;
IF (
PRESENT(lj_charmm)) llj_charmm = lj_charmm
1097 lwilliams = .false.;
IF (
PRESENT(williams)) lwilliams = williams
1098 lgoodwin = .false.;
IF (
PRESENT(goodwin)) lgoodwin = goodwin
1099 leam = .false.;
IF (
PRESENT(eam)) leam = eam
1100 lnequip = .false.;
IF (
PRESENT(nequip)) lnequip = nequip
1101 lace = .false.;
IF (
PRESENT(ace)) lace = ace
1102 ldeepmd = .false.;
IF (
PRESENT(deepmd)) ldeepmd = deepmd
1103 lbmhft = .false.;
IF (
PRESENT(bmhft)) lbmhft = bmhft
1104 lbmhftd = .false.;
IF (
PRESENT(bmhftd)) lbmhftd = bmhftd
1105 lipbv = .false.;
IF (
PRESENT(ipbv)) lipbv = ipbv
1106 lbuck4r = .false.;
IF (
PRESENT(buck4r)) lbuck4r = buck4r
1107 lbuckmo = .false.;
IF (
PRESENT(buckmo)) lbuckmo = buckmo
1108 lgp = .false.;
IF (
PRESENT(gp)) lgp = gp
1109 ltersoff = .false.;
IF (
PRESENT(tersoff)) ltersoff = tersoff
1110 lsiepmann = .false.;
IF (
PRESENT(siepmann)) lsiepmann = siepmann
1111 lgal = .false.;
IF (
PRESENT(gal)) lgal = gal
1112 lgal21 = .false.;
IF (
PRESENT(gal21)) lgal21 = gal21
1113 ltab = .false.;
IF (
PRESENT(tab)) ltab = tab
1117 check = .NOT. (llj_charmm .OR. lwilliams .OR. lgoodwin .OR. leam .OR. lnequip &
1118 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lbuckmo .OR. lgp .OR. ltersoff &
1119 .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1122 IF (llj_charmm)
THEN
1124 check = .NOT. (llj .OR. lwilliams .OR. lgoodwin .OR. leam .OR. lnequip &
1125 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lbuckmo .OR. lgp .OR. ltersoff &
1126 .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1131 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. leam .OR. lnequip &
1132 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lbuckmo .OR. lgp .OR. ltersoff &
1133 .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1138 check = .NOT. (llj .OR. llj_charmm .OR. lwilliams .OR. leam .OR. lnequip &
1139 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lbuckmo .OR. lgp .OR. ltersoff &
1140 .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1145 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. lnequip &
1146 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lbuckmo .OR. lgp .OR. ltersoff &
1147 .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1152 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam &
1153 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lbuckmo .OR. lgp .OR. ltersoff &
1154 .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1159 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1160 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lbuckmo .OR. lgp &
1161 .OR. ltersoff .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd)
1166 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1167 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lbuckmo .OR. lgp &
1168 .OR. ltersoff .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. lace)
1173 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1174 .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lbuckmo .OR. lgp .OR. ltersoff &
1175 .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1180 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1181 .OR. lbmhft .OR. lipbv .OR. lbuck4r .OR. lbuckmo .OR. lgp .OR. ltersoff &
1182 .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1187 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1188 .OR. lbmhft .OR. lbmhftd .OR. lbuck4r .OR. lbuckmo .OR. lgp .OR. ltersoff &
1189 .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1194 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1195 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuckmo .OR. lgp .OR. ltersoff &
1196 .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1201 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1202 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lgp .OR. ltersoff &
1203 .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1208 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1209 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lgp .OR. lbuckmo &
1210 .OR. lsiepmann .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1215 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1216 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lgp .OR. lbuckmo &
1217 .OR. ltersoff .OR. lgal .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1222 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1223 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lgp .OR. lbuckmo &
1224 .OR. ltersoff .OR. lsiepmann .OR. lgal21 .OR. ltab .OR. ldeepmd .OR. lace)
1229 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1230 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lgp .OR. lbuckmo &
1231 .OR. ltersoff .OR. lsiepmann .OR. lgal .OR. ltab .OR. ldeepmd .OR. lace)
1236 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1237 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lgal21 .OR. lbuckmo &
1238 .OR. ltersoff .OR. lsiepmann .OR. lgal .OR. ltab .OR. ldeepmd .OR. lace)
1243 check = .NOT. (llj .OR. llj_charmm .OR. lgoodwin .OR. lwilliams .OR. leam .OR. lnequip &
1244 .OR. lbmhft .OR. lbmhftd .OR. lipbv .OR. lbuck4r .OR. lgp .OR. lgal21 &
1245 .OR. lbuckmo .OR. ltersoff .OR. lsiepmann .OR. lgal .OR. lace)
1251 IF (
ASSOCIATED(p))
THEN
1252 lb1_old = lbound(p%pot, 1)
1253 ub1_old = ubound(p%pot, 1)
1254 CALL pair_potential_p_create(work, lb=lb1_old, ub=ub1_old)
1255 CALL pair_potential_p_copy(p, work)
1259 CALL pair_potential_p_create(p, lb=lb1_new, ub=ub1_new)
1260 IF (
ASSOCIATED(work))
THEN
1261 CALL pair_potential_p_copy(work, p, istart=lb1_old, iend=ub1_old)
1264 DO i = ub1_old + 1, ub1_new
1265 check = (
SIZE(p%pot(i)%pot%type) == std_dim) .AND. (
SIZE(p%pot(i)%pot%type) == std_dim)
1269 p%pot(i)%pot%undef = .true.
1270 p%pot(i)%pot%no_mb = .false.
1271 p%pot(i)%pot%no_pp = .false.
1272 p%pot(i)%pot%at1 =
'NULL'
1273 p%pot(i)%pot%at2 =
'NULL'
1280 CALL pair_potential_williams_create(p%pot(i)%pot%set(std_dim)%willis)
1282 CALL pair_potential_goodwin_create(p%pot(i)%pot%set(std_dim)%goodwin)
1284 CALL pair_potential_eam_create(p%pot(i)%pot%set(std_dim)%eam)
1286 CALL pair_potential_nequip_create(p%pot(i)%pot%set(std_dim)%nequip)
1288 CALL pair_potential_ace_create(p%pot(i)%pot%set(std_dim)%ace)
1290 CALL pair_potential_deepmd_create(p%pot(i)%pot%set(std_dim)%deepmd)
1292 CALL pair_potential_bmhft_create(p%pot(i)%pot%set(std_dim)%ft)
1294 CALL pair_potential_bmhftd_create(p%pot(i)%pot%set(std_dim)%ftd)
1296 CALL pair_potential_ipbv_create(p%pot(i)%pot%set(std_dim)%ipbv)
1298 CALL pair_potential_buck4r_create(p%pot(i)%pot%set(std_dim)%buck4r)
1300 CALL pair_potential_buckmo_create(p%pot(i)%pot%set(std_dim)%buckmo)
1302 CALL pair_potential_gp_create(p%pot(i)%pot%set(std_dim)%gp)
1304 CALL pair_potential_tersoff_create(p%pot(i)%pot%set(std_dim)%tersoff)
1306 CALL pair_potential_siepmann_create(p%pot(i)%pot%set(std_dim)%siepmann)
1308 CALL pair_potential_gal_create(p%pot(i)%pot%set(std_dim)%gal)
1310 CALL pair_potential_gal21_create(p%pot(i)%pot%set(std_dim)%gal21)
1312 CALL pair_potential_tab_create(p%pot(i)%pot%set(std_dim)%tab)
1314 NULLIFY (p%pot(i)%pot%spl_f)
1315 NULLIFY (p%pot(i)%pot%pair_spline_data)
1326 SUBROUTINE pair_potential_gp_create(gp)
1327 TYPE(gp_pot_type),
POINTER :: gp
1329 cpassert(.NOT.
ASSOCIATED(gp))
1331 NULLIFY (gp%parameters)
1333 CALL pair_potential_gp_clean(gp)
1334 END SUBROUTINE pair_potential_gp_create
1342 SUBROUTINE pair_potential_gp_copy(gp_source, gp_dest)
1343 TYPE(gp_pot_type),
POINTER :: gp_source, gp_dest
1347 IF (.NOT.
ASSOCIATED(gp_source))
RETURN
1348 IF (
ASSOCIATED(gp_dest))
CALL pair_potential_gp_release(gp_dest)
1349 CALL pair_potential_gp_create(gp_dest)
1350 gp_dest%myid = gp_source%myid
1351 gp_dest%potential = gp_source%potential
1352 gp_dest%variables = gp_source%variables
1353 IF (
ASSOCIATED(gp_source%parameters))
THEN
1354 idim =
SIZE(gp_source%parameters)
1355 ALLOCATE (gp_dest%parameters(idim))
1356 gp_dest%parameters = gp_source%parameters
1358 IF (
ASSOCIATED(gp_source%values))
THEN
1359 idim =
SIZE(gp_source%values)
1360 ALLOCATE (gp_dest%values(idim))
1361 gp_dest%values = gp_source%values
1363 END SUBROUTINE pair_potential_gp_copy
1370 SUBROUTINE pair_potential_gp_clean(gp)
1371 TYPE(gp_pot_type),
POINTER :: gp
1373 IF (.NOT.
ASSOCIATED(gp))
RETURN
1377 IF (
ASSOCIATED(gp%values))
THEN
1378 DEALLOCATE (gp%values)
1380 IF (
ASSOCIATED(gp%parameters))
THEN
1381 DEALLOCATE (gp%parameters)
1383 END SUBROUTINE pair_potential_gp_clean
1390 SUBROUTINE pair_potential_gp_release(gp)
1391 TYPE(gp_pot_type),
POINTER :: gp
1393 IF (
ASSOCIATED(gp))
THEN
1394 IF (
ASSOCIATED(gp%parameters))
THEN
1395 DEALLOCATE (gp%parameters)
1397 IF (
ASSOCIATED(gp%values))
THEN
1398 DEALLOCATE (gp%values)
1403 END SUBROUTINE pair_potential_gp_release
1411 TYPE(lj_pot_type),
POINTER :: lj
1413 cpassert(.NOT.
ASSOCIATED(lj))
1415 CALL pair_potential_lj_clean(lj)
1424 SUBROUTINE pair_potential_lj_copy(lj_source, lj_dest)
1425 TYPE(lj_pot_type),
POINTER :: lj_source, lj_dest
1427 IF (.NOT.
ASSOCIATED(lj_source))
RETURN
1428 IF (
ASSOCIATED(lj_dest))
CALL pair_potential_lj_release(lj_dest)
1430 lj_dest%epsilon = lj_source%epsilon
1431 lj_dest%sigma6 = lj_source%sigma6
1432 lj_dest%sigma12 = lj_source%sigma12
1433 END SUBROUTINE pair_potential_lj_copy
1440 SUBROUTINE pair_potential_lj_clean(lj)
1441 TYPE(lj_pot_type),
POINTER :: lj
1443 IF (.NOT.
ASSOCIATED(lj))
RETURN
1447 END SUBROUTINE pair_potential_lj_clean
1454 SUBROUTINE pair_potential_lj_release(lj)
1455 TYPE(lj_pot_type),
POINTER :: lj
1457 IF (
ASSOCIATED(lj))
THEN
1461 END SUBROUTINE pair_potential_lj_release
1468 SUBROUTINE pair_potential_williams_create(willis)
1469 TYPE(williams_pot_type),
POINTER :: willis
1471 cpassert(.NOT.
ASSOCIATED(willis))
1473 CALL pair_potential_williams_clean(willis)
1474 END SUBROUTINE pair_potential_williams_create
1482 SUBROUTINE pair_potential_williams_copy(willis_source, willis_dest)
1483 TYPE(williams_pot_type),
POINTER :: willis_source, willis_dest
1485 IF (.NOT.
ASSOCIATED(willis_source))
RETURN
1486 IF (
ASSOCIATED(willis_dest))
CALL pair_potential_williams_release(willis_dest)
1487 CALL pair_potential_williams_create(willis_dest)
1488 willis_dest%a = willis_source%a
1489 willis_dest%b = willis_source%b
1490 willis_dest%c = willis_source%c
1491 END SUBROUTINE pair_potential_williams_copy
1498 SUBROUTINE pair_potential_williams_clean(willis)
1499 TYPE(williams_pot_type),
POINTER :: willis
1501 IF (.NOT.
ASSOCIATED(willis))
RETURN
1505 END SUBROUTINE pair_potential_williams_clean
1512 SUBROUTINE pair_potential_williams_release(willis)
1513 TYPE(williams_pot_type),
POINTER :: willis
1515 IF (
ASSOCIATED(willis))
THEN
1519 END SUBROUTINE pair_potential_williams_release
1526 SUBROUTINE pair_potential_goodwin_create(goodwin)
1527 TYPE(goodwin_pot_type),
POINTER :: goodwin
1529 cpassert(.NOT.
ASSOCIATED(goodwin))
1531 CALL pair_potential_goodwin_clean(goodwin)
1532 END SUBROUTINE pair_potential_goodwin_create
1540 SUBROUTINE pair_potential_goodwin_copy(goodwin_source, goodwin_dest)
1541 TYPE(goodwin_pot_type),
POINTER :: goodwin_source, goodwin_dest
1543 IF (.NOT.
ASSOCIATED(goodwin_source))
RETURN
1544 IF (
ASSOCIATED(goodwin_dest))
CALL pair_potential_goodwin_release(goodwin_dest)
1545 CALL pair_potential_goodwin_create(goodwin_dest)
1546 goodwin_dest%vr0 = goodwin_source%vr0
1547 goodwin_dest%d = goodwin_source%d
1548 goodwin_dest%dc = goodwin_source%dc
1549 goodwin_dest%m = goodwin_source%m
1550 goodwin_dest%mc = goodwin_source%mc
1551 END SUBROUTINE pair_potential_goodwin_copy
1558 SUBROUTINE pair_potential_goodwin_clean(goodwin)
1559 TYPE(goodwin_pot_type),
POINTER :: goodwin
1561 IF (.NOT.
ASSOCIATED(goodwin))
RETURN
1562 goodwin%vr0 = 0.0_dp
1567 END SUBROUTINE pair_potential_goodwin_clean
1574 SUBROUTINE pair_potential_goodwin_release(goodwin)
1575 TYPE(goodwin_pot_type),
POINTER :: goodwin
1577 IF (
ASSOCIATED(goodwin))
THEN
1578 DEALLOCATE (goodwin)
1581 END SUBROUTINE pair_potential_goodwin_release
1588 SUBROUTINE pair_potential_eam_create(eam)
1591 cpassert(.NOT.
ASSOCIATED(eam))
1593 NULLIFY (eam%rho, eam%phi, eam%frho, eam%rhoval, eam%rval, &
1594 eam%rhop, eam%phip, eam%frhop)
1595 CALL pair_potential_eam_clean(eam)
1596 END SUBROUTINE pair_potential_eam_create
1604 SUBROUTINE pair_potential_eam_copy(eam_source, eam_dest)
1607 IF (.NOT.
ASSOCIATED(eam_source))
RETURN
1608 IF (
ASSOCIATED(eam_dest))
CALL pair_potential_eam_release(eam_dest)
1609 CALL pair_potential_eam_create(eam_dest)
1610 eam_dest%eam_file_name = eam_source%eam_file_name
1611 eam_dest%drar = eam_source%drar
1612 eam_dest%drhoar = eam_source%drhoar
1613 eam_dest%acutal = eam_source%acutal
1614 eam_dest%npoints = eam_source%npoints
1616 CALL reallocate(eam_dest%rho, 1, eam_dest%npoints)
1617 CALL reallocate(eam_dest%rhop, 1, eam_dest%npoints)
1618 CALL reallocate(eam_dest%phi, 1, eam_dest%npoints)
1619 CALL reallocate(eam_dest%phip, 1, eam_dest%npoints)
1620 CALL reallocate(eam_dest%frho, 1, eam_dest%npoints)
1621 CALL reallocate(eam_dest%frhop, 1, eam_dest%npoints)
1622 CALL reallocate(eam_dest%rval, 1, eam_dest%npoints)
1623 CALL reallocate(eam_dest%rhoval, 1, eam_dest%npoints)
1624 eam_dest%rho = eam_source%rho
1625 eam_dest%phi = eam_source%phi
1626 eam_dest%frho = eam_source%frho
1627 eam_dest%rhoval = eam_source%rhoval
1628 eam_dest%rval = eam_source%rval
1629 eam_dest%rhop = eam_source%rhop
1630 eam_dest%phip = eam_source%phip
1631 eam_dest%frhop = eam_source%frhop
1632 END SUBROUTINE pair_potential_eam_copy
1639 SUBROUTINE pair_potential_eam_clean(eam)
1642 IF (.NOT.
ASSOCIATED(eam))
RETURN
1643 eam%eam_file_name =
'NULL'
1656 END SUBROUTINE pair_potential_eam_clean
1663 SUBROUTINE pair_potential_eam_release(eam)
1666 IF (
ASSOCIATED(eam))
THEN
1667 IF (
ASSOCIATED(eam%rho))
THEN
1668 DEALLOCATE (eam%rho)
1670 IF (
ASSOCIATED(eam%rhop))
THEN
1671 DEALLOCATE (eam%rhop)
1673 IF (
ASSOCIATED(eam%phi))
THEN
1674 DEALLOCATE (eam%phi)
1676 IF (
ASSOCIATED(eam%phip))
THEN
1677 DEALLOCATE (eam%phip)
1679 IF (
ASSOCIATED(eam%frho))
THEN
1680 DEALLOCATE (eam%frho)
1682 IF (
ASSOCIATED(eam%frhop))
THEN
1683 DEALLOCATE (eam%frhop)
1685 IF (
ASSOCIATED(eam%rval))
THEN
1686 DEALLOCATE (eam%rval)
1688 IF (
ASSOCIATED(eam%rhoval))
THEN
1689 DEALLOCATE (eam%rhoval)
1693 END SUBROUTINE pair_potential_eam_release
1700 SUBROUTINE pair_potential_ace_create(ace)
1703 cpassert(.NOT.
ASSOCIATED(ace))
1705 END SUBROUTINE pair_potential_ace_create
1713 SUBROUTINE pair_potential_ace_copy(ace_source, ace_dest)
1716 IF (.NOT.
ASSOCIATED(ace_source))
RETURN
1718 IF (
ASSOCIATED(ace_dest))
CALL pair_potential_ace_release(ace_dest)
1719 CALL pair_potential_ace_create(ace_dest)
1720 ace_dest = ace_source
1721 END SUBROUTINE pair_potential_ace_copy
1728 SUBROUTINE pair_potential_ace_clean(ace)
1731 IF (.NOT.
ASSOCIATED(ace))
RETURN
1733 END SUBROUTINE pair_potential_ace_clean
1740 SUBROUTINE pair_potential_ace_release(ace)
1743 IF (
ASSOCIATED(ace))
THEN
1746 END SUBROUTINE pair_potential_ace_release
1753 SUBROUTINE pair_potential_deepmd_create(deepmd)
1756 cpassert(.NOT.
ASSOCIATED(deepmd))
1758 END SUBROUTINE pair_potential_deepmd_create
1766 SUBROUTINE pair_potential_deepmd_copy(deepmd_source, deepmd_dest)
1769 IF (.NOT.
ASSOCIATED(deepmd_source))
RETURN
1770 NULLIFY (deepmd_dest)
1771 IF (
ASSOCIATED(deepmd_dest))
CALL pair_potential_deepmd_release(deepmd_dest)
1772 CALL pair_potential_deepmd_create(deepmd_dest)
1773 deepmd_dest = deepmd_source
1774 END SUBROUTINE pair_potential_deepmd_copy
1781 SUBROUTINE pair_potential_deepmd_clean(deepmd)
1784 IF (.NOT.
ASSOCIATED(deepmd))
RETURN
1786 END SUBROUTINE pair_potential_deepmd_clean
1793 SUBROUTINE pair_potential_deepmd_release(deepmd)
1796 IF (
ASSOCIATED(deepmd))
THEN
1799 END SUBROUTINE pair_potential_deepmd_release
1806 SUBROUTINE pair_potential_nequip_create(nequip)
1809 cpassert(.NOT.
ASSOCIATED(nequip))
1811 END SUBROUTINE pair_potential_nequip_create
1819 SUBROUTINE pair_potential_nequip_copy(nequip_source, nequip_dest)
1822 IF (.NOT.
ASSOCIATED(nequip_source))
RETURN
1823 IF (
ASSOCIATED(nequip_dest))
CALL pair_potential_nequip_release(nequip_dest)
1824 CALL pair_potential_nequip_create(nequip_dest)
1825 nequip_dest = nequip_source
1827 END SUBROUTINE pair_potential_nequip_copy
1834 SUBROUTINE pair_potential_nequip_clean(nequip)
1837 IF (.NOT.
ASSOCIATED(nequip))
RETURN
1840 END SUBROUTINE pair_potential_nequip_clean
1847 SUBROUTINE pair_potential_nequip_release(nequip)
1850 IF (
ASSOCIATED(nequip))
THEN
1853 END SUBROUTINE pair_potential_nequip_release
1860 SUBROUTINE pair_potential_bmhft_create(ft)
1863 cpassert(.NOT.
ASSOCIATED(ft))
1865 CALL pair_potential_bmhft_clean(ft)
1866 END SUBROUTINE pair_potential_bmhft_create
1874 SUBROUTINE pair_potential_bmhft_copy(ft_source, ft_dest)
1877 IF (.NOT.
ASSOCIATED(ft_source))
RETURN
1878 IF (
ASSOCIATED(ft_dest))
CALL pair_potential_bmhft_release(ft_dest)
1879 CALL pair_potential_bmhft_create(ft_dest)
1880 ft_dest%A = ft_source%A
1881 ft_dest%B = ft_source%B
1882 ft_dest%C = ft_source%C
1883 ft_dest%D = ft_source%D
1884 END SUBROUTINE pair_potential_bmhft_copy
1891 SUBROUTINE pair_potential_bmhft_clean(ft)
1894 IF (.NOT.
ASSOCIATED(ft))
RETURN
1899 END SUBROUTINE pair_potential_bmhft_clean
1906 SUBROUTINE pair_potential_bmhft_release(ft)
1909 IF (
ASSOCIATED(ft))
THEN
1913 END SUBROUTINE pair_potential_bmhft_release
1920 SUBROUTINE pair_potential_bmhftd_create(ftd)
1921 TYPE(ftd_pot_type),
POINTER :: ftd
1923 cpassert(.NOT.
ASSOCIATED(ftd))
1925 CALL pair_potential_bmhftd_clean(ftd)
1926 END SUBROUTINE pair_potential_bmhftd_create
1934 SUBROUTINE pair_potential_bmhftd_copy(ftd_source, ftd_dest)
1935 TYPE(ftd_pot_type),
POINTER :: ftd_source, ftd_dest
1937 IF (.NOT.
ASSOCIATED(ftd_source))
RETURN
1938 IF (
ASSOCIATED(ftd_dest))
CALL pair_potential_bmhftd_release(ftd_dest)
1939 CALL pair_potential_bmhftd_create(ftd_dest)
1940 ftd_dest%A = ftd_source%A
1941 ftd_dest%B = ftd_source%B
1942 ftd_dest%C = ftd_source%C
1943 ftd_dest%D = ftd_source%D
1944 ftd_dest%BD = ftd_source%BD
1945 END SUBROUTINE pair_potential_bmhftd_copy
1952 SUBROUTINE pair_potential_bmhftd_clean(ftd)
1953 TYPE(ftd_pot_type),
POINTER :: ftd
1955 IF (.NOT.
ASSOCIATED(ftd))
RETURN
1961 END SUBROUTINE pair_potential_bmhftd_clean
1968 SUBROUTINE pair_potential_bmhftd_release(ftd)
1969 TYPE(ftd_pot_type),
POINTER :: ftd
1971 IF (
ASSOCIATED(ftd))
THEN
1975 END SUBROUTINE pair_potential_bmhftd_release
1982 SUBROUTINE pair_potential_ipbv_create(ipbv)
1985 cpassert(.NOT.
ASSOCIATED(ipbv))
1987 CALL pair_potential_ipbv_clean(ipbv)
1988 END SUBROUTINE pair_potential_ipbv_create
1996 SUBROUTINE pair_potential_ipbv_copy(ipbv_source, ipbv_dest)
1999 IF (.NOT.
ASSOCIATED(ipbv_source))
RETURN
2000 IF (
ASSOCIATED(ipbv_dest))
CALL pair_potential_ipbv_release(ipbv_dest)
2001 CALL pair_potential_ipbv_create(ipbv_dest)
2002 ipbv_dest%a = ipbv_source%a
2003 ipbv_dest%rcore = ipbv_source%rcore
2004 ipbv_dest%b = ipbv_source%b
2005 ipbv_dest%m = ipbv_source%m
2006 END SUBROUTINE pair_potential_ipbv_copy
2013 SUBROUTINE pair_potential_ipbv_clean(ipbv)
2016 IF (.NOT.
ASSOCIATED(ipbv))
RETURN
2021 END SUBROUTINE pair_potential_ipbv_clean
2028 SUBROUTINE pair_potential_ipbv_release(ipbv)
2031 IF (
ASSOCIATED(ipbv))
THEN
2035 END SUBROUTINE pair_potential_ipbv_release
2042 SUBROUTINE pair_potential_buck4r_create(buck4r)
2043 TYPE(buck4ran_pot_type),
POINTER :: buck4r
2045 cpassert(.NOT.
ASSOCIATED(buck4r))
2047 CALL pair_potential_buck4r_clean(buck4r)
2048 END SUBROUTINE pair_potential_buck4r_create
2056 SUBROUTINE pair_potential_buck4r_copy(buck4r_source, buck4r_dest)
2057 TYPE(buck4ran_pot_type),
POINTER :: buck4r_source, buck4r_dest
2059 IF (.NOT.
ASSOCIATED(buck4r_source))
RETURN
2060 IF (
ASSOCIATED(buck4r_dest))
CALL pair_potential_buck4r_release(buck4r_dest)
2061 CALL pair_potential_buck4r_create(buck4r_dest)
2062 buck4r_dest%a = buck4r_source%a
2063 buck4r_dest%b = buck4r_source%b
2064 buck4r_dest%c = buck4r_source%c
2065 buck4r_dest%r1 = buck4r_source%r1
2066 buck4r_dest%r2 = buck4r_source%r2
2067 buck4r_dest%r3 = buck4r_source%r3
2068 buck4r_dest%poly1 = buck4r_source%poly1
2069 buck4r_dest%poly2 = buck4r_source%poly2
2070 buck4r_dest%npoly1 = buck4r_source%npoly1
2071 buck4r_dest%npoly2 = buck4r_source%npoly2
2072 END SUBROUTINE pair_potential_buck4r_copy
2079 SUBROUTINE pair_potential_buck4r_clean(buck4r)
2080 TYPE(buck4ran_pot_type),
POINTER :: buck4r
2082 IF (.NOT.
ASSOCIATED(buck4r))
RETURN
2089 buck4r%poly1 = 0.0_dp
2091 buck4r%poly2 = 0.0_dp
2093 END SUBROUTINE pair_potential_buck4r_clean
2100 SUBROUTINE pair_potential_buck4r_release(buck4r)
2101 TYPE(buck4ran_pot_type),
POINTER :: buck4r
2103 IF (
ASSOCIATED(buck4r))
THEN
2107 END SUBROUTINE pair_potential_buck4r_release
2114 SUBROUTINE pair_potential_buckmo_create(buckmo)
2115 TYPE(buckmorse_pot_type),
POINTER :: buckmo
2117 cpassert(.NOT.
ASSOCIATED(buckmo))
2119 CALL pair_potential_buckmo_clean(buckmo)
2120 END SUBROUTINE pair_potential_buckmo_create
2128 SUBROUTINE pair_potential_buckmo_copy(buckmo_source, buckmo_dest)
2129 TYPE(buckmorse_pot_type),
POINTER :: buckmo_source, buckmo_dest
2131 IF (.NOT.
ASSOCIATED(buckmo_source))
RETURN
2132 IF (
ASSOCIATED(buckmo_dest))
CALL pair_potential_buckmo_release(buckmo_dest)
2133 CALL pair_potential_buckmo_create(buckmo_dest)
2134 buckmo_dest%f0 = buckmo_source%f0
2135 buckmo_dest%a1 = buckmo_source%a1
2136 buckmo_dest%a2 = buckmo_source%a2
2137 buckmo_dest%b1 = buckmo_source%b1
2138 buckmo_dest%b2 = buckmo_source%b2
2139 buckmo_dest%c = buckmo_source%c
2140 buckmo_dest%d = buckmo_source%d
2141 buckmo_dest%r0 = buckmo_source%r0
2142 buckmo_dest%beta = buckmo_source%beta
2143 END SUBROUTINE pair_potential_buckmo_copy
2150 SUBROUTINE pair_potential_buckmo_clean(buckmo)
2151 TYPE(buckmorse_pot_type),
POINTER :: buckmo
2153 IF (.NOT.
ASSOCIATED(buckmo))
RETURN
2162 buckmo%beta = 0.0_dp
2163 END SUBROUTINE pair_potential_buckmo_clean
2170 SUBROUTINE pair_potential_buckmo_release(buckmo)
2171 TYPE(buckmorse_pot_type),
POINTER :: buckmo
2173 IF (
ASSOCIATED(buckmo))
THEN
2177 END SUBROUTINE pair_potential_buckmo_release
2184 SUBROUTINE pair_potential_tersoff_create(tersoff)
2187 cpassert(.NOT.
ASSOCIATED(tersoff))
2189 CALL pair_potential_tersoff_clean(tersoff)
2190 END SUBROUTINE pair_potential_tersoff_create
2198 SUBROUTINE pair_potential_tersoff_copy(tersoff_source, tersoff_dest)
2201 IF (.NOT.
ASSOCIATED(tersoff_source))
RETURN
2202 IF (
ASSOCIATED(tersoff_dest))
CALL pair_potential_tersoff_release(tersoff_dest)
2203 CALL pair_potential_tersoff_create(tersoff_dest)
2204 tersoff_dest%A = tersoff_source%A
2205 tersoff_dest%B = tersoff_source%B
2206 tersoff_dest%lambda1 = tersoff_source%lambda1
2207 tersoff_dest%lambda2 = tersoff_source%lambda2
2208 tersoff_dest%alpha = tersoff_source%alpha
2209 tersoff_dest%beta = tersoff_source%beta
2210 tersoff_dest%n = tersoff_source%n
2211 tersoff_dest%c = tersoff_source%c
2212 tersoff_dest%d = tersoff_source%d
2213 tersoff_dest%h = tersoff_source%h
2214 tersoff_dest%lambda3 = tersoff_source%lambda3
2215 tersoff_dest%bigR = tersoff_source%bigR
2216 tersoff_dest%bigD = tersoff_source%bigD
2217 tersoff_dest%rcutsq = tersoff_source%rcutsq
2218 END SUBROUTINE pair_potential_tersoff_copy
2225 SUBROUTINE pair_potential_tersoff_clean(tersoff)
2228 IF (.NOT.
ASSOCIATED(tersoff))
RETURN
2231 tersoff%lambda1 = 0.0_dp
2232 tersoff%lambda2 = 0.0_dp
2233 tersoff%alpha = 0.0_dp
2234 tersoff%beta = 0.0_dp
2239 tersoff%lambda3 = 0.0_dp
2240 tersoff%bigR = 0.0_dp
2241 tersoff%bigD = 0.0_dp
2242 tersoff%rcutsq = 0.0_dp
2243 END SUBROUTINE pair_potential_tersoff_clean
2250 SUBROUTINE pair_potential_tersoff_release(tersoff)
2253 IF (
ASSOCIATED(tersoff))
THEN
2254 DEALLOCATE (tersoff)
2257 END SUBROUTINE pair_potential_tersoff_release
2264 SUBROUTINE pair_potential_siepmann_create(siepmann)
2267 cpassert(.NOT.
ASSOCIATED(siepmann))
2269 CALL pair_potential_siepmann_clean(siepmann)
2270 END SUBROUTINE pair_potential_siepmann_create
2277 SUBROUTINE pair_potential_siepmann_copy(siepmann_source, siepmann_dest)
2280 IF (.NOT.
ASSOCIATED(siepmann_source))
RETURN
2281 IF (
ASSOCIATED(siepmann_dest))
CALL pair_potential_siepmann_release(siepmann_dest)
2282 CALL pair_potential_siepmann_create(siepmann_dest)
2283 siepmann_dest%B = siepmann_source%B
2284 siepmann_dest%D = siepmann_source%D
2285 siepmann_dest%E = siepmann_source%E
2286 siepmann_dest%F = siepmann_source%F
2287 siepmann_dest%beta = siepmann_source%beta
2288 siepmann_dest%rcutsq = siepmann_source%rcutsq
2289 siepmann_dest%allow_oh_formation = siepmann_source%allow_oh_formation
2290 siepmann_dest%allow_h3o_formation = siepmann_source%allow_h3o_formation
2291 siepmann_dest%allow_o_formation = siepmann_source%allow_o_formation
2293 END SUBROUTINE pair_potential_siepmann_copy
2300 SUBROUTINE pair_potential_siepmann_clean(siepmann)
2303 IF (.NOT.
ASSOCIATED(siepmann))
RETURN
2308 siepmann%beta = 0.0_dp
2309 siepmann%rcutsq = 0.0_dp
2310 siepmann%allow_oh_formation = .false.
2311 siepmann%allow_h3o_formation = .false.
2312 siepmann%allow_o_formation = .false.
2314 END SUBROUTINE pair_potential_siepmann_clean
2321 SUBROUTINE pair_potential_siepmann_release(siepmann)
2324 IF (
ASSOCIATED(siepmann))
THEN
2325 DEALLOCATE (siepmann)
2328 END SUBROUTINE pair_potential_siepmann_release
2335 SUBROUTINE pair_potential_gal_create(gal)
2338 cpassert(.NOT.
ASSOCIATED(gal))
2340 CALL pair_potential_gal_clean(gal)
2341 END SUBROUTINE pair_potential_gal_create
2349 SUBROUTINE pair_potential_gal_copy(gal_source, gal_dest)
2352 IF (.NOT.
ASSOCIATED(gal_source))
RETURN
2353 IF (
ASSOCIATED(gal_dest))
CALL pair_potential_gal_release(gal_dest)
2354 CALL pair_potential_gal_create(gal_dest)
2355 gal_dest%met1 = gal_source%met1
2356 gal_dest%met2 = gal_source%met2
2357 gal_dest%epsilon = gal_source%epsilon
2358 gal_dest%bxy = gal_source%bxy
2359 gal_dest%bz = gal_source%bz
2360 gal_dest%r1 = gal_source%r1
2361 gal_dest%r2 = gal_source%r2
2362 gal_dest%a1 = gal_source%a1
2363 gal_dest%a2 = gal_source%a2
2364 gal_dest%a3 = gal_source%a3
2365 gal_dest%a4 = gal_source%a4
2366 gal_dest%a = gal_source%a
2367 gal_dest%b = gal_source%b
2368 gal_dest%c = gal_source%c
2369 ALLOCATE (gal_dest%gcn(
SIZE(gal_source%gcn)))
2370 gal_dest%gcn = gal_source%gcn
2371 gal_dest%express = gal_source%express
2372 gal_dest%rcutsq = gal_source%rcutsq
2374 END SUBROUTINE pair_potential_gal_copy
2381 SUBROUTINE pair_potential_gal_clean(gal)
2384 IF (.NOT.
ASSOCIATED(gal))
RETURN
2385 gal%epsilon = 0.0_dp
2398 gal%express = .false.
2400 END SUBROUTINE pair_potential_gal_clean
2407 SUBROUTINE pair_potential_gal_release(gal)
2410 IF (
ASSOCIATED(gal))
THEN
2411 DEALLOCATE (gal%gcn)
2415 END SUBROUTINE pair_potential_gal_release
2422 SUBROUTINE pair_potential_gal21_create(gal21)
2425 cpassert(.NOT.
ASSOCIATED(gal21))
2427 CALL pair_potential_gal21_clean(gal21)
2428 END SUBROUTINE pair_potential_gal21_create
2436 SUBROUTINE pair_potential_gal21_copy(gal21_source, gal21_dest)
2439 IF (.NOT.
ASSOCIATED(gal21_source))
RETURN
2440 IF (
ASSOCIATED(gal21_dest))
CALL pair_potential_gal21_release(gal21_dest)
2441 CALL pair_potential_gal21_create(gal21_dest)
2442 gal21_dest%met1 = gal21_source%met1
2443 gal21_dest%met2 = gal21_source%met2
2444 gal21_dest%epsilon1 = gal21_source%epsilon1
2445 gal21_dest%epsilon2 = gal21_source%epsilon2
2446 gal21_dest%epsilon3 = gal21_source%epsilon3
2447 gal21_dest%bxy1 = gal21_source%bxy1
2448 gal21_dest%bxy2 = gal21_source%bxy2
2449 gal21_dest%bz1 = gal21_source%bz1
2450 gal21_dest%bz2 = gal21_source%bz2
2451 gal21_dest%r1 = gal21_source%r1
2452 gal21_dest%r2 = gal21_source%r2
2453 gal21_dest%a11 = gal21_source%a11
2454 gal21_dest%a12 = gal21_source%a12
2455 gal21_dest%a13 = gal21_source%a13
2456 gal21_dest%a21 = gal21_source%a21
2457 gal21_dest%a22 = gal21_source%a22
2458 gal21_dest%a23 = gal21_source%a23
2459 gal21_dest%a31 = gal21_source%a31
2460 gal21_dest%a32 = gal21_source%a32
2461 gal21_dest%a33 = gal21_source%a33
2462 gal21_dest%a41 = gal21_source%a41
2463 gal21_dest%a42 = gal21_source%a42
2464 gal21_dest%a43 = gal21_source%a43
2465 gal21_dest%AO1 = gal21_source%AO1
2466 gal21_dest%AO2 = gal21_source%AO2
2467 gal21_dest%BO1 = gal21_source%BO1
2468 gal21_dest%BO2 = gal21_source%BO2
2469 gal21_dest%c = gal21_source%c
2470 gal21_dest%AH1 = gal21_source%AH1
2471 gal21_dest%AH2 = gal21_source%AH2
2472 gal21_dest%BH1 = gal21_source%BH1
2473 gal21_dest%BH2 = gal21_source%BH2
2474 ALLOCATE (gal21_dest%gcn(
SIZE(gal21_source%gcn)))
2475 gal21_dest%gcn = gal21_source%gcn
2476 gal21_dest%express = gal21_source%express
2477 gal21_dest%rcutsq = gal21_source%rcutsq
2479 END SUBROUTINE pair_potential_gal21_copy
2486 SUBROUTINE pair_potential_gal21_clean(gal21)
2489 IF (.NOT.
ASSOCIATED(gal21))
RETURN
2490 gal21%epsilon1 = 0.0_dp
2491 gal21%epsilon2 = 0.0_dp
2492 gal21%epsilon3 = 0.0_dp
2520 gal21%rcutsq = 0.0_dp
2521 gal21%express = .false.
2523 END SUBROUTINE pair_potential_gal21_clean
2530 SUBROUTINE pair_potential_gal21_release(gal21)
2533 IF (
ASSOCIATED(gal21))
THEN
2534 DEALLOCATE (gal21%gcn)
2538 END SUBROUTINE pair_potential_gal21_release
2545 SUBROUTINE pair_potential_tab_create(tab)
2548 cpassert(.NOT.
ASSOCIATED(tab))
2550 NULLIFY (tab%r, tab%e, tab%f)
2551 CALL pair_potential_tab_clean(tab)
2552 END SUBROUTINE pair_potential_tab_create
2559 SUBROUTINE pair_potential_tab_copy(tab_source, tab_dest)
2562 IF (.NOT.
ASSOCIATED(tab_source))
RETURN
2563 IF (
ASSOCIATED(tab_dest))
CALL pair_potential_tab_release(tab_dest)
2564 CALL pair_potential_tab_create(tab_dest)
2565 tab_dest%tabpot_file_name = tab_source%tabpot_file_name
2566 tab_dest%dr = tab_source%dr
2567 tab_dest%rcut = tab_source%rcut
2568 tab_dest%npoints = tab_source%npoints
2569 tab_dest%index = tab_source%index
2571 CALL reallocate(tab_dest%r, 1, tab_dest%npoints)
2572 CALL reallocate(tab_dest%e, 1, tab_dest%npoints)
2573 CALL reallocate(tab_dest%f, 1, tab_dest%npoints)
2574 tab_dest%r = tab_source%r
2575 tab_dest%e = tab_source%e
2576 tab_dest%f = tab_source%f
2577 END SUBROUTINE pair_potential_tab_copy
2583 SUBROUTINE pair_potential_tab_clean(tab)
2586 IF (.NOT.
ASSOCIATED(tab))
RETURN
2587 tab%tabpot_file_name =
'NULL'
2596 END SUBROUTINE pair_potential_tab_clean
2602 SUBROUTINE pair_potential_tab_release(tab)
2605 IF (
ASSOCIATED(tab))
THEN
2606 IF (
ASSOCIATED(tab%r))
THEN
2609 IF (
ASSOCIATED(tab%e))
THEN
2612 IF (
ASSOCIATED(tab%f))
THEN
2617 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
integer, dimension(21), parameter, public list_pot
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, 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 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