80#include "./base/base_uses.f90"
84 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'force_fields_input'
104 SUBROUTINE read_force_field_section1(ff_section, mm_section, ff_type, para_env)
105 TYPE(section_vals_type),
POINTER :: ff_section, mm_section
106 TYPE(force_field_type),
INTENT(INOUT) :: ff_type
107 TYPE(mp_para_env_type),
POINTER :: para_env
109 CHARACTER(LEN=default_string_length), &
110 DIMENSION(:),
POINTER :: atm_names
111 INTEGER :: nace, nb4, nbends, nbm, nbmhft, nbmhftd, nbonds, nchg, ndeepmd, neam, ngal, &
112 ngal21, ngd, ngp, nimpr, nipbv, nlj, nnequip, nopbend, nshell, nsiepmann, ntab, ntersoff, &
113 ntors, ntot, nubs, nwl
114 LOGICAL :: explicit, unique_spline
115 REAL(KIND=
dp) :: min_eps_spline_allowed
116 TYPE(input_info_type),
POINTER :: inp_info
117 TYPE(section_vals_type),
POINTER :: tmp_section, tmp_section2
121 NULLIFY (tmp_section, tmp_section2)
122 inp_info => ff_type%inp_info
132 CALL section_vals_val_get(ff_section,
"IGNORE_MISSING_CRITICAL_PARAMS", l_val=ff_type%ignore_missing_critical)
133 cpassert(ff_type%max_energy <= ff_type%emax_spline)
135 SELECT CASE (ff_type%ff_type)
138 IF (trim(ff_type%ff_file_name) ==
"") &
139 cpabort(
"Force Field Parameter's filename is empty! Please check your input file.")
143 cpabort(
"Force field type not implemented")
151 min_eps_spline_allowed = 20.0_dp*max(ff_type%max_energy, 10.0_dp)*epsilon(0.0_dp)
152 IF (ff_type%eps_spline < min_eps_spline_allowed)
THEN
153 CALL cp_warn(__location__, &
154 "Requested spline accuracy ("//trim(
cp_to_string(ff_type%eps_spline))//
" ) "// &
155 "is smaller than the minimum value allowed ("//trim(
cp_to_string(min_eps_spline_allowed))// &
156 " ) with the present machine precision ("//trim(
cp_to_string(epsilon(0.0_dp)))//
" ). "// &
157 "New EPS_SPLINE value ("//trim(
cp_to_string(min_eps_spline_allowed))//
" ). ")
158 ff_type%eps_spline = min_eps_spline_allowed
171 IF (explicit .AND. ff_type%do_nonbonded)
THEN
193 CALL read_eam_section(inp_info%nonbonded, tmp_section2, ntot, para_env, mm_section)
198 ntot = nlj + nwl + neam
206 ntot = nlj + nwl + neam + ngd
209 CALL read_ipbv_section(inp_info%nonbonded, tmp_section2, ntot)
214 ntot = nlj + nwl + neam + ngd + nipbv
217 CALL read_bmhft_section(inp_info%nonbonded, tmp_section2, ntot)
221 CALL section_vals_get(tmp_section2, explicit=explicit, n_repetition=nbmhftd)
222 ntot = nlj + nwl + neam + ngd + nipbv + nbmhft
225 CALL read_bmhftd_section(inp_info%nonbonded, tmp_section2, ntot)
230 ntot = nlj + nwl + neam + ngd + nipbv + nbmhft + nbmhftd
233 CALL read_b4_section(inp_info%nonbonded, tmp_section2, ntot)
238 ntot = nlj + nwl + neam + ngd + nipbv + nbmhft + nbmhftd + nb4
241 CALL read_bm_section(inp_info%nonbonded, tmp_section2, ntot)
246 ntot = nlj + nwl + neam + ngd + nipbv + nbmhft + nbmhftd + nb4 + nbm
252 CALL section_vals_get(tmp_section2, explicit=explicit, n_repetition=ntersoff)
253 ntot = nlj + nwl + neam + ngd + nipbv + nbmhft + nbmhftd + nb4 + nbm + ngp
256 CALL read_tersoff_section(inp_info%nonbonded, tmp_section2, ntot, tmp_section2)
261 ntot = nlj + nwl + neam + ngd + nipbv + nbmhft + nbmhftd + nb4 + nbm + ngp + ntersoff
264 CALL read_gal_section(inp_info%nonbonded, tmp_section2, ntot, tmp_section2)
269 ntot = nlj + nwl + neam + ngd + nipbv + nbmhft + nbmhftd + nb4 + nbm + ngp + ntersoff + ngal
272 CALL read_gal21_section(inp_info%nonbonded, tmp_section2, ntot, tmp_section2)
276 CALL section_vals_get(tmp_section2, explicit=explicit, n_repetition=nsiepmann)
277 ntot = nlj + nwl + neam + ngd + nipbv + nbmhft + nbmhftd + nb4 + nbm + ngp + ntersoff + ngal + ngal21
280 CALL read_siepmann_section(inp_info%nonbonded, tmp_section2, ntot, tmp_section2)
284 CALL section_vals_get(tmp_section2, explicit=explicit, n_repetition=nnequip)
285 ntot = nlj + nwl + neam + ngd + nipbv + nbmhft + nbmhftd + nb4 + nbm + ngp + ntersoff + &
286 ngal + ngal21 + nsiepmann
290 nnequip = nnequip - 1 +
SIZE(atm_names) + (
SIZE(atm_names)*
SIZE(atm_names) -
SIZE(atm_names))/2
292 CALL read_nequip_section(inp_info%nonbonded, tmp_section2, ntot)
297 ntot = nlj + nwl + neam + ngd + nipbv + nbmhft + nbmhftd + nb4 + nbm + ngp + ntersoff + &
298 ngal + ngal21 + nsiepmann + nnequip
301 CALL read_tabpot_section(inp_info%nonbonded, tmp_section2, ntot, para_env, mm_section)
305 CALL section_vals_get(tmp_section2, explicit=explicit, n_repetition=ndeepmd)
306 ntot = nlj + nwl + neam + ngd + nipbv + nbmhft + nbmhftd + nb4 + nbm + ngp + ntersoff + &
307 ngal + ngal21 + nsiepmann + nnequip + ntab
311 ndeepmd = ndeepmd - 1 +
SIZE(atm_names) + (
SIZE(atm_names)*
SIZE(atm_names) -
SIZE(atm_names))/2
313 CALL read_deepmd_section(inp_info%nonbonded, tmp_section2, ntot)
318 ntot = nlj + nwl + neam + ngd + nipbv + nbmhft + nbmhftd + nb4 + nbm + ngp + ntersoff + &
319 ngal + ngal21 + nsiepmann + nnequip + ntab + ndeepmd
323 nace = nace - 1 +
SIZE(atm_names) + (
SIZE(atm_names)*
SIZE(atm_names) -
SIZE(atm_names))/2
325 CALL read_ace_section(inp_info%nonbonded, tmp_section2, ntot)
332 IF (explicit .AND. ff_type%do_nonbonded)
THEN
356 ntot = nlj + nwl + ngd
377 CALL read_apol_section(inp_info%apol_atm, inp_info%apol, inp_info%damping_list, &
386 CALL read_cpol_section(inp_info%cpol_atm, inp_info%cpol, tmp_section, ntot)
393 CALL read_shell_section(inp_info%shell_list, tmp_section, ntot)
400 CALL reallocate(inp_info%bond_kind, 1, nbonds)
403 CALL reallocate(inp_info%bond_k, 1, 3, 1, nbonds)
406 CALL read_bonds_section(inp_info%bond_kind, inp_info%bond_a, inp_info%bond_b, inp_info%bond_k, &
407 inp_info%bond_r0, inp_info%bond_cs, tmp_section, ntot)
413 CALL reallocate(inp_info%bend_kind, 1, nbends)
418 CALL reallocate(inp_info%bend_theta0, 1, nbends)
420 CALL reallocate(inp_info%bend_r012, 1, nbends)
421 CALL reallocate(inp_info%bend_r032, 1, nbends)
422 CALL reallocate(inp_info%bend_kbs12, 1, nbends)
423 CALL reallocate(inp_info%bend_kbs32, 1, nbends)
425 IF (
ASSOCIATED(inp_info%bend_legendre))
THEN
426 DO i = 1,
SIZE(inp_info%bend_legendre)
427 IF (
ASSOCIATED(inp_info%bend_legendre(i)%coeffs))
THEN
428 DEALLOCATE (inp_info%bend_legendre(i)%coeffs)
429 NULLIFY (inp_info%bend_legendre(i)%coeffs)
432 DEALLOCATE (inp_info%bend_legendre)
433 NULLIFY (inp_info%bend_legendre)
435 ALLOCATE (inp_info%bend_legendre(1:nbends))
436 DO i = 1,
SIZE(inp_info%bend_legendre(1:nbends))
437 NULLIFY (inp_info%bend_legendre(i)%coeffs)
438 inp_info%bend_legendre(i)%order = 0
440 CALL read_bends_section(inp_info%bend_kind, inp_info%bend_a, inp_info%bend_b, inp_info%bend_c, &
441 inp_info%bend_k, inp_info%bend_theta0, inp_info%bend_cb, &
442 inp_info%bend_r012, inp_info%bend_r032, inp_info%bend_kbs12, &
443 inp_info%bend_kbs32, inp_info%bend_kss, &
444 inp_info%bend_legendre, tmp_section, ntot)
456 CALL read_ubs_section(inp_info%ub_kind, inp_info%ub_a, inp_info%ub_b, inp_info%ub_c, &
457 inp_info%ub_k, inp_info%ub_r0, tmp_section, ntot)
463 CALL reallocate(inp_info%torsion_kind, 1, ntors)
470 CALL reallocate(inp_info%torsion_phi0, 1, ntors)
471 CALL read_torsions_section(inp_info%torsion_kind, inp_info%torsion_a, inp_info%torsion_b, &
472 inp_info%torsion_c, inp_info%torsion_d, inp_info%torsion_k, inp_info%torsion_phi0, &
473 inp_info%torsion_m, tmp_section, ntot)
487 CALL read_improper_section(inp_info%impr_kind, inp_info%impr_a, inp_info%impr_b, &
488 inp_info%impr_c, inp_info%impr_d, inp_info%impr_k, inp_info%impr_phi0, &
496 CALL reallocate(inp_info%opbend_kind, 1, nopbend)
497 CALL reallocate(inp_info%opbend_a, 1, nopbend)
498 CALL reallocate(inp_info%opbend_b, 1, nopbend)
499 CALL reallocate(inp_info%opbend_c, 1, nopbend)
500 CALL reallocate(inp_info%opbend_d, 1, nopbend)
501 CALL reallocate(inp_info%opbend_k, 1, nopbend)
502 CALL reallocate(inp_info%opbend_phi0, 1, nopbend)
503 CALL read_opbend_section(inp_info%opbend_kind, inp_info%opbend_a, inp_info%opbend_b, &
504 inp_info%opbend_c, inp_info%opbend_d, inp_info%opbend_k, inp_info%opbend_phi0, &
508 END SUBROUTINE read_force_field_section1
517 SUBROUTINE set_ipbv_ff(at1, at2, ipbv)
518 CHARACTER(LEN=*),
INTENT(IN) :: at1, at2
519 TYPE(ipbv_pot_type),
POINTER :: ipbv
521 IF ((at1(1:1) ==
'O') .AND. (at2(1:1) ==
'O'))
THEN
523 ipbv%m = -1.2226442563398141e+11_dp
524 ipbv%b = 1.1791292385486696e+11_dp
527 ipbv%a(2) = 4.786380682394_dp
528 ipbv%a(3) = -1543.407053545_dp
529 ipbv%a(4) = 88783.31188529_dp
530 ipbv%a(5) = -2361200.155376_dp
531 ipbv%a(6) = 35940504.84679_dp
532 ipbv%a(7) = -339762743.6358_dp
533 ipbv%a(8) = 2043874926.466_dp
534 ipbv%a(9) = -7654856796.383_dp
535 ipbv%a(10) = 16195251405.65_dp
536 ipbv%a(11) = -13140392992.18_dp
537 ipbv%a(12) = -9285572894.245_dp
538 ipbv%a(13) = 8756947519.029_dp
539 ipbv%a(14) = 15793297761.67_dp
540 ipbv%a(15) = 12917180227.21_dp
541 ELSEIF (((at1(1:1) ==
'O') .AND. (at2(1:1) ==
'H')) .OR. &
542 ((at1(1:1) ==
'H') .AND. (at2(1:1) ==
'O')))
THEN
545 ipbv%m = -0.004025691139759147_dp
546 ipbv%b = -2.193731138097428_dp
548 ipbv%a(2) = -195.7716013277_dp
549 ipbv%a(3) = 15343.78613395_dp
550 ipbv%a(4) = -530864.4586516_dp
551 ipbv%a(5) = 10707934.39058_dp
552 ipbv%a(6) = -140099704.7890_dp
553 ipbv%a(7) = 1250943273.785_dp
554 ipbv%a(8) = -7795458330.676_dp
555 ipbv%a(9) = 33955897217.31_dp
556 ipbv%a(10) = -101135640744.0_dp
557 ipbv%a(11) = 193107995718.7_dp
558 ipbv%a(12) = -193440560940.0_dp
559 ipbv%a(13) = -4224406093.918e0_dp
560 ipbv%a(14) = 217192386506.5e0_dp
561 ipbv%a(15) = -157581228915.5_dp
562 ELSEIF ((at1(1:1) ==
'H') .AND. (at2(1:1) ==
'H'))
THEN
563 ipbv%rcore = 3.165_dp
564 ipbv%m = 0.002639704108787555_dp
565 ipbv%b = -0.2735482611857583_dp
567 ipbv%a(2) = -26.29456010782_dp
568 ipbv%a(3) = 2373.352548248_dp
569 ipbv%a(4) = -93880.43551360_dp
570 ipbv%a(5) = 2154624.884809_dp
571 ipbv%a(6) = -31965151.34955_dp
572 ipbv%a(7) = 322781785.3278_dp
573 ipbv%a(8) = -2271097368.668_dp
574 ipbv%a(9) = 11169163192.90_dp
575 ipbv%a(10) = -37684457778.47_dp
576 ipbv%a(11) = 82562104256.03_dp
577 ipbv%a(12) = -100510435213.4_dp
578 ipbv%a(13) = 24570342714.65e0_dp
579 ipbv%a(14) = 88766181532.94e0_dp
580 ipbv%a(15) = -79705131323.98_dp
582 cpabort(
"IPBV only for WATER")
584 END SUBROUTINE set_ipbv_ff
593 SUBROUTINE set_bmhft_ff(at1, at2, ft)
594 CHARACTER(LEN=*),
INTENT(IN) :: at1, at2
595 TYPE(ft_pot_type),
POINTER :: ft
598 IF ((at1(1:2) ==
'NA') .AND. (at2(1:2) ==
'NA'))
THEN
602 ELSEIF (((at1(1:2) ==
'NA') .AND. (at2(1:2) ==
'CL')) .OR. &
603 ((at1(1:2) ==
'CL') .AND. (at2(1:2) ==
'NA')))
THEN
607 ELSEIF ((at1(1:2) ==
'CL') .AND. (at2(1:2) ==
'CL'))
THEN
612 cpabort(
"BMHFT only for NaCl")
615 END SUBROUTINE set_bmhft_ff
621 SUBROUTINE set_bmhftd_ff()
623 cpabort(
"No default parameters present for BMHFTD")
625 END SUBROUTINE set_bmhftd_ff
636 SUBROUTINE read_eam_section(nonbonded, section, start, para_env, mm_section)
637 TYPE(pair_potential_p_type),
POINTER :: nonbonded
638 TYPE(section_vals_type),
POINTER :: section
639 INTEGER,
INTENT(IN) :: start
640 TYPE(mp_para_env_type),
POINTER :: para_env
641 TYPE(section_vals_type),
POINTER :: mm_section
643 CHARACTER(LEN=default_string_length), &
644 DIMENSION(:),
POINTER :: atm_names
645 INTEGER :: isec, n_items
651 nonbonded%pot(start + isec)%pot%type =
ea_type
652 nonbonded%pot(start + isec)%pot%at1 = atm_names(1)
653 nonbonded%pot(start + isec)%pot%at2 = atm_names(2)
654 CALL uppercase(nonbonded%pot(start + isec)%pot%at1)
655 CALL uppercase(nonbonded%pot(start + isec)%pot%at2)
657 c_val=nonbonded%pot(start + isec)%pot%set(1)%eam%eam_file_name)
658 CALL read_eam_data(nonbonded%pot(start + isec)%pot%set(1)%eam, para_env, mm_section)
659 nonbonded%pot(start + isec)%pot%rcutsq = nonbonded%pot(start + isec)%pot%set(1)%eam%acutal**2
661 END SUBROUTINE read_eam_section
669 SUBROUTINE read_ace_section(nonbonded, section, start)
670 TYPE(pair_potential_p_type),
POINTER :: nonbonded
671 TYPE(section_vals_type),
POINTER :: section
672 INTEGER,
INTENT(IN) :: start
674 CHARACTER(LEN=2),
ALLOCATABLE,
DIMENSION(:) :: ace_atype_symbol
675 CHARACTER(LEN=default_path_length) :: ace_filename
676 CHARACTER(LEN=default_string_length) :: ace_file_name
677 CHARACTER(LEN=default_string_length), &
678 DIMENSION(:),
POINTER :: atm_names
679 INTEGER :: ace_ntype, isec, jsec, n_items
680 REAL(KIND=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: rcutall
681 TYPE(ace_model_type) :: model
685 n_items = isec*n_items
688 ace_ntype =
SIZE(atm_names)
689 ALLOCATE (ace_atype_symbol(ace_ntype), rcutall(ace_ntype, ace_ntype))
690 DO isec = 1, ace_ntype
691 ace_atype_symbol(isec) = atm_names(isec) (1:2)
700 fname=trim(ace_filename), rcutc=rcutall, model=model)
702 cpabort(
"CP2K was compiled without ACE library.")
705 DO isec = 1,
SIZE(atm_names)
706 DO jsec = isec,
SIZE(atm_names)
707 nonbonded%pot(start + n_items)%pot%type =
ace_type
708 nonbonded%pot(start + n_items)%pot%at1 = atm_names(isec)
709 nonbonded%pot(start + n_items)%pot%at2 = atm_names(jsec)
710 CALL uppercase(nonbonded%pot(start + n_items)%pot%at1)
711 CALL uppercase(nonbonded%pot(start + n_items)%pot%at2)
713 nonbonded%pot(start + n_items)%pot%set(1)%ace%ace_file_name = ace_filename
714 nonbonded%pot(start + n_items)%pot%set(1)%ace%atom_ace_type = isec
715 nonbonded%pot(start + n_items)%pot%set(1)%ace%model = model
719 nonbonded%pot(start + n_items)%pot%rcutsq =
cp_unit_to_cp2k(rcutall(isec, jsec),
"angstrom")**2
721 n_items = n_items + 1
724 END SUBROUTINE read_ace_section
733 SUBROUTINE read_deepmd_section(nonbonded, section, start)
734 TYPE(pair_potential_p_type),
POINTER :: nonbonded
735 TYPE(section_vals_type),
POINTER :: section
736 INTEGER,
INTENT(IN) :: start
738 CHARACTER(LEN=default_string_length) :: deepmd_file_name
739 CHARACTER(LEN=default_string_length), &
740 DIMENSION(:),
POINTER :: atm_names
741 INTEGER :: isec, jsec, n_items
742 INTEGER,
DIMENSION(:),
POINTER :: atm_deepmd_types
746 n_items = isec*n_items
751 DO isec = 1,
SIZE(atm_names)
752 DO jsec = isec,
SIZE(atm_names)
753 nonbonded%pot(start + n_items)%pot%type =
deepmd_type
754 nonbonded%pot(start + n_items)%pot%at1 = atm_names(isec)
755 nonbonded%pot(start + n_items)%pot%at2 = atm_names(jsec)
756 CALL uppercase(nonbonded%pot(start + n_items)%pot%at1)
757 CALL uppercase(nonbonded%pot(start + n_items)%pot%at2)
759 nonbonded%pot(start + n_items)%pot%set(1)%deepmd%deepmd_file_name =
discover_file(deepmd_file_name)
760 nonbonded%pot(start + n_items)%pot%set(1)%deepmd%atom_deepmd_type = atm_deepmd_types(isec)
761 nonbonded%pot(start + n_items)%pot%rcutsq = 0.0_dp
762 n_items = n_items + 1
765 END SUBROUTINE read_deepmd_section
774 SUBROUTINE read_nequip_section(nonbonded, section, start)
775 TYPE(pair_potential_p_type),
POINTER :: nonbonded
776 TYPE(section_vals_type),
POINTER :: section
777 INTEGER,
INTENT(IN) :: start
779 CHARACTER(LEN=default_string_length) :: model_type_str, pot_file_name, &
780 unit_energy, unit_forces, unit_length
781 CHARACTER(LEN=default_string_length), &
782 DIMENSION(:),
POINTER :: atm_names
783 INTEGER :: chosen_type, isec, jsec, n_items
784 TYPE(nequip_pot_type) :: nequip
788 n_items = isec*n_items
797 IF (trim(model_type_str) ==
"ALLEGRO")
THEN
799 ELSE IF (trim(model_type_str) ==
"NEQUIP")
THEN
802 CALL cp_abort(__location__, &
803 "Unknown MODEL_TYPE: "//trim(model_type_str)//
". Use NEQUIP or ALLEGRO.")
807 nequip%unit_length = unit_length
808 nequip%unit_forces = unit_forces
809 nequip%unit_energy = unit_energy
810 CALL read_nequip_data(nequip)
811 CALL check_cp2k_atom_names_in_torch(atm_names, nequip%type_names_torch)
813 DO isec = 1,
SIZE(atm_names)
814 DO jsec = isec,
SIZE(atm_names)
815 nonbonded%pot(start + n_items)%pot%type = chosen_type
816 nonbonded%pot(start + n_items)%pot%at1 = atm_names(isec)
817 nonbonded%pot(start + n_items)%pot%at2 = atm_names(jsec)
818 CALL uppercase(nonbonded%pot(start + n_items)%pot%at1)
819 CALL uppercase(nonbonded%pot(start + n_items)%pot%at2)
820 nonbonded%pot(start + n_items)%pot%set(1)%nequip = nequip
821 nonbonded%pot(start + n_items)%pot%rcutsq = nequip%rcutsq
822 n_items = n_items + 1
826 END SUBROUTINE read_nequip_section
838 INTEGER,
INTENT(IN) :: start
840 CHARACTER(LEN=default_string_length), &
841 DIMENSION(:),
POINTER :: atm_names
842 INTEGER :: isec, n_items, n_rep
843 REAL(kind=
dp) :: epsilon, rcut, sigma
853 nonbonded%pot(start + isec)%pot%at1 = atm_names(1)
854 nonbonded%pot(start + isec)%pot%at2 = atm_names(2)
855 CALL uppercase(nonbonded%pot(start + isec)%pot%at1)
856 CALL uppercase(nonbonded%pot(start + isec)%pot%at2)
857 nonbonded%pot(start + isec)%pot%set(1)%lj%epsilon = epsilon
858 nonbonded%pot(start + isec)%pot%set(1)%lj%sigma6 = sigma**6
859 nonbonded%pot(start + isec)%pot%set(1)%lj%sigma12 = sigma**12
860 nonbonded%pot(start + isec)%pot%rcutsq = rcut*rcut
864 r_val=nonbonded%pot(start + isec)%pot%set(1)%rmin)
867 r_val=nonbonded%pot(start + isec)%pot%set(1)%rmax)
881 INTEGER,
INTENT(IN) :: start
883 CHARACTER(LEN=default_string_length), &
884 DIMENSION(:),
POINTER :: atm_names
885 INTEGER :: isec, n_items, n_rep
886 REAL(kind=
dp) :: a, b, c, rcut
896 nonbonded%pot(start + isec)%pot%type =
wl_type
897 nonbonded%pot(start + isec)%pot%at1 = atm_names(1)
898 nonbonded%pot(start + isec)%pot%at2 = atm_names(2)
899 CALL uppercase(nonbonded%pot(start + isec)%pot%at1)
900 CALL uppercase(nonbonded%pot(start + isec)%pot%at2)
901 nonbonded%pot(start + isec)%pot%set(1)%willis%a = a
902 nonbonded%pot(start + isec)%pot%set(1)%willis%b = b
903 nonbonded%pot(start + isec)%pot%set(1)%willis%c = c
904 nonbonded%pot(start + isec)%pot%rcutsq = rcut*rcut
908 r_val=nonbonded%pot(start + isec)%pot%set(1)%rmin)
911 r_val=nonbonded%pot(start + isec)%pot%set(1)%rmax)
925 INTEGER,
INTENT(IN) :: start
927 CHARACTER(LEN=default_string_length), &
928 DIMENSION(:),
POINTER :: atm_names
929 INTEGER :: isec, m, mc, n_items, n_rep
930 REAL(kind=
dp) :: d, dc, rcut, vr0
942 nonbonded%pot(start + isec)%pot%type =
gw_type
943 nonbonded%pot(start + isec)%pot%at1 = atm_names(1)
944 nonbonded%pot(start + isec)%pot%at2 = atm_names(2)
945 CALL uppercase(nonbonded%pot(start + isec)%pot%at1)
946 CALL uppercase(nonbonded%pot(start + isec)%pot%at2)
947 nonbonded%pot(start + isec)%pot%set(1)%goodwin%vr0 = vr0
948 nonbonded%pot(start + isec)%pot%set(1)%goodwin%d = d
949 nonbonded%pot(start + isec)%pot%set(1)%goodwin%dc = dc
950 nonbonded%pot(start + isec)%pot%set(1)%goodwin%m = m
951 nonbonded%pot(start + isec)%pot%set(1)%goodwin%mc = mc
952 nonbonded%pot(start + isec)%pot%rcutsq = rcut*rcut
956 r_val=nonbonded%pot(start + isec)%pot%set(1)%rmin)
959 r_val=nonbonded%pot(start + isec)%pot%set(1)%rmax)
970 SUBROUTINE read_ipbv_section(nonbonded, section, start)
973 INTEGER,
INTENT(IN) :: start
975 CHARACTER(LEN=default_string_length), &
976 DIMENSION(:),
POINTER :: atm_names
977 INTEGER :: isec, n_items, n_rep
978 REAL(kind=
dp) :: rcut
983 nonbonded%pot(start + isec)%pot%type =
ip_type
984 nonbonded%pot(start + isec)%pot%at1 = atm_names(1)
985 nonbonded%pot(start + isec)%pot%at2 = atm_names(2)
986 CALL uppercase(nonbonded%pot(start + isec)%pot%at1)
987 CALL uppercase(nonbonded%pot(start + isec)%pot%at2)
988 CALL set_ipbv_ff(nonbonded%pot(start + isec)%pot%at1, nonbonded%pot(start + isec)%pot%at2, &
989 nonbonded%pot(start + isec)%pot%set(1)%ipbv)
991 nonbonded%pot(start + isec)%pot%rcutsq = rcut**2
995 r_val=nonbonded%pot(start + isec)%pot%set(1)%rmin)
998 r_val=nonbonded%pot(start + isec)%pot%set(1)%rmax)
1000 END SUBROUTINE read_ipbv_section
1009 SUBROUTINE read_bmhft_section(nonbonded, section, start)
1012 INTEGER,
INTENT(IN) :: start
1014 CHARACTER(LEN=default_string_length),
DIMENSION(2) :: map_atoms
1015 CHARACTER(LEN=default_string_length), &
1016 DIMENSION(:),
POINTER :: atm_names
1017 INTEGER :: i, isec, n_items, n_rep
1018 REAL(kind=
dp) :: rcut
1021 DO isec = 1, n_items
1025 nonbonded%pot(start + isec)%pot%type =
ft_type
1026 nonbonded%pot(start + isec)%pot%at1 = atm_names(1)
1027 nonbonded%pot(start + isec)%pot%at2 = atm_names(2)
1028 CALL uppercase(nonbonded%pot(start + isec)%pot%at1)
1029 CALL uppercase(nonbonded%pot(start + isec)%pot%at2)
1034 r_val=nonbonded%pot(start + isec)%pot%set(1)%ft%a)
1036 r_val=nonbonded%pot(start + isec)%pot%set(1)%ft%b)
1038 r_val=nonbonded%pot(start + isec)%pot%set(1)%ft%c)
1040 r_val=nonbonded%pot(start + isec)%pot%set(1)%ft%d)
1043 map_atoms = atm_names
1046 CALL set_bmhft_ff(map_atoms(1), map_atoms(2), nonbonded%pot(start + isec)%pot%set(1)%ft)
1049 nonbonded%pot(start + isec)%pot%rcutsq = rcut**2
1053 r_val=nonbonded%pot(start + isec)%pot%set(1)%rmin)
1056 r_val=nonbonded%pot(start + isec)%pot%set(1)%rmax)
1058 END SUBROUTINE read_bmhft_section
1067 SUBROUTINE read_bmhftd_section(nonbonded, section, start)
1070 INTEGER,
INTENT(IN) :: start
1072 CHARACTER(LEN=default_string_length),
DIMENSION(2) :: map_atoms
1073 CHARACTER(LEN=default_string_length), &
1074 DIMENSION(:),
POINTER :: atm_names
1075 INTEGER :: i, isec, n_items, n_rep
1076 REAL(kind=
dp) :: rcut
1077 REAL(kind=
dp),
DIMENSION(:),
POINTER :: bd_vals
1083 DO isec = 1, n_items
1087 nonbonded%pot(start + isec)%pot%type =
ftd_type
1088 nonbonded%pot(start + isec)%pot%at1 = atm_names(1)
1089 nonbonded%pot(start + isec)%pot%at2 = atm_names(2)
1090 CALL uppercase(nonbonded%pot(start + isec)%pot%at1)
1091 CALL uppercase(nonbonded%pot(start + isec)%pot%at2)
1096 r_val=nonbonded%pot(start + isec)%pot%set(1)%ftd%a)
1098 r_val=nonbonded%pot(start + isec)%pot%set(1)%ftd%b)
1100 r_val=nonbonded%pot(start + isec)%pot%set(1)%ftd%c)
1102 r_val=nonbonded%pot(start + isec)%pot%set(1)%ftd%d)
1104 IF (
ASSOCIATED(bd_vals))
THEN
1105 SELECT CASE (
SIZE(bd_vals))
1107 cpabort(
"No values specified for parameter BD in section &BMHFTD")
1109 nonbonded%pot(start + isec)%pot%set(1)%ftd%bd(1:2) = bd_vals(1)
1111 nonbonded%pot(start + isec)%pot%set(1)%ftd%bd(1:2) = bd_vals(1:2)
1113 cpabort(
"Too many values specified for parameter BD in section &BMHFTD")
1116 cpabort(
"Parameter BD in section &BMHFTD was not specified")
1120 map_atoms = atm_names
1123 CALL set_bmhftd_ff()
1126 nonbonded%pot(start + isec)%pot%rcutsq = rcut**2
1130 r_val=nonbonded%pot(start + isec)%pot%set(1)%rmin)
1133 r_val=nonbonded%pot(start + isec)%pot%set(1)%rmax)
1135 END SUBROUTINE read_bmhftd_section
1146 SUBROUTINE read_b4_section(nonbonded, section, start)
1150 INTEGER,
INTENT(IN) :: start
1152 CHARACTER(LEN=default_string_length), &
1153 DIMENSION(:),
POINTER :: atm_names
1154 INTEGER :: i, ir, isec, n_items, n_rep, np1, np2
1155 LOGICAL :: explicit_poly1, explicit_poly2
1156 REAL(kind=
dp) :: a, b, c, eval_error, r1, r2, r3, rcut
1157 REAL(kind=
dp),
DIMENSION(10) :: v, x
1158 REAL(kind=
dp),
DIMENSION(10, 10) :: p, p_inv
1159 REAL(kind=
dp),
DIMENSION(:),
POINTER :: coeff1, coeff2,
list
1166 DO isec = 1, n_items
1176 IF (explicit_poly1)
THEN
1181 IF (
ASSOCIATED(
list))
THEN
1183 DO i = 1,
SIZE(
list)
1184 coeff1(i + np1 - 1) =
list(i)
1186 np1 = np1 +
SIZE(
list)
1191 IF (explicit_poly2)
THEN
1196 IF (
ASSOCIATED(
list))
THEN
1198 DO i = 1,
SIZE(
list)
1199 coeff2(i + np2 - 1) =
list(i)
1201 np2 = np2 +
SIZE(
list)
1206 IF ((.NOT. explicit_poly1) .OR. (.NOT. explicit_poly2))
THEN
1213 p(1, i) = p(1, i - 1)*r1
1217 p(2, i) = real(i - 1, kind=
dp)*p(1, i - 1)
1221 p(3, i) = real(i - 1, kind=
dp)*p(2, i - 1)
1226 p(4, i) = p(4, i - 1)*r2
1230 p(4, i) = p(4, i - 1)*r2
1234 p(5, i) = real(i - 1, kind=
dp)*p(4, i - 1)
1237 p(5, i) = real(i - 7, kind=
dp)*p(4, i - 1)
1241 p(6, i) = real(i - 1, kind=
dp)*p(5, i - 1)
1244 p(6, i) = real(i - 7, kind=
dp)*p(5, i - 1)
1253 p(8, i) = p(8, i - 1)*r3
1257 p(9, i) = real(i - 7, kind=
dp)*p(8, i - 1)
1261 p(10, i) = real(i - 7, kind=
dp)*p(9, i - 1)
1268 v(8) = -c/p(8, 10)**2
1269 v(9) = -6.0_dp*v(8)/r3
1270 v(10) = -7.0_dp*v(9)/r3
1272 p_inv(:, :) = 0.0_dp
1274 IF (eval_error >= 1.0e-8_dp) &
1275 CALL cp_warn(__location__, &
1276 "The polynomial fit for the BUCK4RANGES potential is only accurate to "// &
1280 x(:) = matmul(p_inv(:, :), v(:))
1287 nonbonded%pot(start + isec)%pot%type =
b4_type
1288 nonbonded%pot(start + isec)%pot%at1 = atm_names(1)
1289 nonbonded%pot(start + isec)%pot%at2 = atm_names(2)
1290 CALL uppercase(nonbonded%pot(start + isec)%pot%at1)
1291 CALL uppercase(nonbonded%pot(start + isec)%pot%at2)
1292 nonbonded%pot(start + isec)%pot%set(1)%buck4r%a = a
1293 nonbonded%pot(start + isec)%pot%set(1)%buck4r%b = b
1294 nonbonded%pot(start + isec)%pot%set(1)%buck4r%c = c
1295 nonbonded%pot(start + isec)%pot%set(1)%buck4r%r1 = r1
1296 nonbonded%pot(start + isec)%pot%set(1)%buck4r%r2 = r2
1297 nonbonded%pot(start + isec)%pot%set(1)%buck4r%r3 = r3
1298 IF ((.NOT. explicit_poly1) .OR. (.NOT. explicit_poly2))
THEN
1299 nonbonded%pot(start + isec)%pot%set(1)%buck4r%npoly1 = 5
1300 nonbonded%pot(start + isec)%pot%set(1)%buck4r%poly1(0:5) = x(1:6)
1301 nonbonded%pot(start + isec)%pot%set(1)%buck4r%npoly2 = 3
1302 nonbonded%pot(start + isec)%pot%set(1)%buck4r%poly2(0:3) = x(7:10)
1304 nonbonded%pot(start + isec)%pot%set(1)%buck4r%npoly1 = np1 - 1
1305 cpassert(np1 - 1 <= 10)
1306 nonbonded%pot(start + isec)%pot%set(1)%buck4r%poly1(0:np1 - 1) = coeff1(0:np1 - 1)
1307 nonbonded%pot(start + isec)%pot%set(1)%buck4r%npoly2 = np2 - 1
1308 cpassert(np2 - 1 <= 10)
1309 nonbonded%pot(start + isec)%pot%set(1)%buck4r%poly2(0:np2 - 1) = coeff2(0:np2 - 1)
1311 nonbonded%pot(start + isec)%pot%rcutsq = rcut*rcut
1313 IF (
ASSOCIATED(coeff1))
THEN
1316 IF (
ASSOCIATED(coeff2))
THEN
1321 r_val=nonbonded%pot(start + isec)%pot%set(1)%rmin)
1324 r_val=nonbonded%pot(start + isec)%pot%set(1)%rmax)
1327 END SUBROUTINE read_b4_section
1339 INTEGER,
INTENT(IN) :: start
1341 CHARACTER(LEN=default_string_length), &
1342 DIMENSION(:),
POINTER :: atm_names
1343 INTEGER :: isec, n_items, n_rep
1344 REAL(kind=
dp) :: rcut
1347 DO isec = 1, n_items
1351 nonbonded%pot(start + isec)%pot%type =
gp_type
1352 nonbonded%pot(start + isec)%pot%at1 = atm_names(1)
1353 nonbonded%pot(start + isec)%pot%at2 = atm_names(2)
1354 nonbonded%pot(start + isec)%pot%rcutsq = rcut*rcut
1355 CALL uppercase(nonbonded%pot(start + isec)%pot%at1)
1356 CALL uppercase(nonbonded%pot(start + isec)%pot%at2)
1358 CALL get_generic_info(section,
"FUNCTION", nonbonded%pot(start + isec)%pot%set(1)%gp%potential, &
1359 nonbonded%pot(start + isec)%pot%set(1)%gp%parameters, &
1360 nonbonded%pot(start + isec)%pot%set(1)%gp%values, &
1361 size_variables=1, i_rep_sec=isec)
1362 nonbonded%pot(start + isec)%pot%set(1)%gp%variables = nonbonded%pot(start + isec)%pot%set(1)%gp%parameters(1)
1366 r_val=nonbonded%pot(start + isec)%pot%set(1)%rmin)
1369 r_val=nonbonded%pot(start + isec)%pot%set(1)%rmax)
1381 SUBROUTINE read_tersoff_section(nonbonded, section, start, tersoff_section)
1384 INTEGER,
INTENT(IN) :: start
1387 CHARACTER(LEN=default_string_length), &
1388 DIMENSION(:),
POINTER :: atm_names
1389 INTEGER :: isec, n_items, n_rep
1390 REAL(kind=
dp) :: rcut, rcutsq
1393 DO isec = 1, n_items
1398 nonbonded%pot(start + isec)%pot%at1 = atm_names(1)
1399 nonbonded%pot(start + isec)%pot%at2 = atm_names(2)
1400 CALL uppercase(nonbonded%pot(start + isec)%pot%at1)
1401 CALL uppercase(nonbonded%pot(start + isec)%pot%at2)
1404 r_val=nonbonded%pot(start + isec)%pot%set(1)%tersoff%A)
1406 r_val=nonbonded%pot(start + isec)%pot%set(1)%tersoff%B)
1408 r_val=nonbonded%pot(start + isec)%pot%set(1)%tersoff%lambda1)
1410 r_val=nonbonded%pot(start + isec)%pot%set(1)%tersoff%lambda2)
1412 r_val=nonbonded%pot(start + isec)%pot%set(1)%tersoff%alpha)
1414 r_val=nonbonded%pot(start + isec)%pot%set(1)%tersoff%beta)
1416 r_val=nonbonded%pot(start + isec)%pot%set(1)%tersoff%n)
1418 r_val=nonbonded%pot(start + isec)%pot%set(1)%tersoff%c)
1420 r_val=nonbonded%pot(start + isec)%pot%set(1)%tersoff%d)
1422 r_val=nonbonded%pot(start + isec)%pot%set(1)%tersoff%h)
1424 r_val=nonbonded%pot(start + isec)%pot%set(1)%tersoff%lambda3)
1426 r_val=nonbonded%pot(start + isec)%pot%set(1)%tersoff%bigR)
1428 r_val=nonbonded%pot(start + isec)%pot%set(1)%tersoff%bigD)
1430 rcutsq = (nonbonded%pot(start + isec)%pot%set(1)%tersoff%bigR + &
1431 nonbonded%pot(start + isec)%pot%set(1)%tersoff%bigD)**2
1432 nonbonded%pot(start + isec)%pot%set(1)%tersoff%rcutsq = rcutsq
1433 nonbonded%pot(start + isec)%pot%rcutsq = rcutsq
1437 IF (n_rep == 1)
THEN
1439 nonbonded%pot(start + isec)%pot%rcutsq = rcut**2
1442 END SUBROUTINE read_tersoff_section
1452 SUBROUTINE read_gal_section(nonbonded, section, start, gal_section)
1455 INTEGER,
INTENT(IN) :: start
1458 CHARACTER(LEN=default_string_length), &
1459 DIMENSION(:),
POINTER :: atm_names
1460 INTEGER :: iatom, isec, n_items, n_rep, nval
1462 REAL(kind=
dp) :: rcut, rval
1463 REAL(kind=
dp),
DIMENSION(:),
POINTER :: rvalues
1469 DO isec = 1, n_items
1473 nonbonded%pot(start + isec)%pot%type =
gal_type
1474 nonbonded%pot(start + isec)%pot%at1 = atm_names(1)
1475 nonbonded%pot(start + isec)%pot%at2 = atm_names(2)
1476 CALL uppercase(nonbonded%pot(start + isec)%pot%at1)
1477 CALL uppercase(nonbonded%pot(start + isec)%pot%at2)
1480 IF (any(len_trim(atm_names(:)) > 2))
THEN
1481 cpwarn(
"The atom name will be truncated.")
1483 nonbonded%pot(start + isec)%pot%set(1)%gal%met1 = trim(atm_names(1))
1484 nonbonded%pot(start + isec)%pot%set(1)%gal%met2 = trim(atm_names(2))
1487 r_val=nonbonded%pot(start + isec)%pot%set(1)%gal%epsilon)
1489 r_val=nonbonded%pot(start + isec)%pot%set(1)%gal%bxy)
1491 r_val=nonbonded%pot(start + isec)%pot%set(1)%gal%bz)
1494 nonbonded%pot(start + isec)%pot%set(1)%gal%r1 = rvalues(1)
1495 nonbonded%pot(start + isec)%pot%set(1)%gal%r2 = rvalues(2)
1498 r_val=nonbonded%pot(start + isec)%pot%set(1)%gal%a1)
1500 r_val=nonbonded%pot(start + isec)%pot%set(1)%gal%a2)
1502 r_val=nonbonded%pot(start + isec)%pot%set(1)%gal%a3)
1504 r_val=nonbonded%pot(start + isec)%pot%set(1)%gal%a4)
1506 r_val=nonbonded%pot(start + isec)%pot%set(1)%gal%a)
1508 r_val=nonbonded%pot(start + isec)%pot%set(1)%gal%b)
1510 r_val=nonbonded%pot(start + isec)%pot%set(1)%gal%c)
1514 ALLOCATE (nonbonded%pot(start + isec)%pot%set(1)%gal%gcn(nval))
1521 nonbonded%pot(start + isec)%pot%set(1)%gal%gcn(iatom) = rval
1525 l_val=nonbonded%pot(start + isec)%pot%set(1)%gal%express)
1529 IF (n_rep == 1)
THEN
1531 nonbonded%pot(start + isec)%pot%rcutsq = rcut**2
1532 nonbonded%pot(start + isec)%pot%set(1)%gal%rcutsq = rcut**2
1535 END SUBROUTINE read_gal_section
1545 SUBROUTINE read_gal21_section(nonbonded, section, start, gal21_section)
1548 INTEGER,
INTENT(IN) :: start
1551 CHARACTER(LEN=default_string_length), &
1552 DIMENSION(:),
POINTER :: atm_names
1553 INTEGER :: iatom, isec, n_items, n_rep, nval
1555 REAL(kind=
dp) :: rcut, rval
1556 REAL(kind=
dp),
DIMENSION(:),
POINTER :: rvalues
1562 DO isec = 1, n_items
1566 nonbonded%pot(start + isec)%pot%type =
gal21_type
1567 nonbonded%pot(start + isec)%pot%at1 = atm_names(1)
1568 nonbonded%pot(start + isec)%pot%at2 = atm_names(2)
1569 CALL uppercase(nonbonded%pot(start + isec)%pot%at1)
1570 CALL uppercase(nonbonded%pot(start + isec)%pot%at2)
1573 IF (any(len_trim(atm_names(:)) > 2))
THEN
1574 cpwarn(
"The atom name will be truncated.")
1576 nonbonded%pot(start + isec)%pot%set(1)%gal21%met1 = trim(atm_names(1))
1577 nonbonded%pot(start + isec)%pot%set(1)%gal21%met2 = trim(atm_names(2))
1580 nonbonded%pot(start + isec)%pot%set(1)%gal21%epsilon1 = rvalues(1)
1581 nonbonded%pot(start + isec)%pot%set(1)%gal21%epsilon2 = rvalues(2)
1582 nonbonded%pot(start + isec)%pot%set(1)%gal21%epsilon3 = rvalues(3)
1585 nonbonded%pot(start + isec)%pot%set(1)%gal21%bxy1 = rvalues(1)
1586 nonbonded%pot(start + isec)%pot%set(1)%gal21%bxy2 = rvalues(2)
1589 nonbonded%pot(start + isec)%pot%set(1)%gal21%bz1 = rvalues(1)
1590 nonbonded%pot(start + isec)%pot%set(1)%gal21%bz2 = rvalues(2)
1593 nonbonded%pot(start + isec)%pot%set(1)%gal21%r1 = rvalues(1)
1594 nonbonded%pot(start + isec)%pot%set(1)%gal21%r2 = rvalues(2)
1597 nonbonded%pot(start + isec)%pot%set(1)%gal21%a11 = rvalues(1)
1598 nonbonded%pot(start + isec)%pot%set(1)%gal21%a12 = rvalues(2)
1599 nonbonded%pot(start + isec)%pot%set(1)%gal21%a13 = rvalues(3)
1602 nonbonded%pot(start + isec)%pot%set(1)%gal21%a21 = rvalues(1)
1603 nonbonded%pot(start + isec)%pot%set(1)%gal21%a22 = rvalues(2)
1604 nonbonded%pot(start + isec)%pot%set(1)%gal21%a23 = rvalues(3)
1607 nonbonded%pot(start + isec)%pot%set(1)%gal21%a31 = rvalues(1)
1608 nonbonded%pot(start + isec)%pot%set(1)%gal21%a32 = rvalues(2)
1609 nonbonded%pot(start + isec)%pot%set(1)%gal21%a33 = rvalues(3)
1612 nonbonded%pot(start + isec)%pot%set(1)%gal21%a41 = rvalues(1)
1613 nonbonded%pot(start + isec)%pot%set(1)%gal21%a42 = rvalues(2)
1614 nonbonded%pot(start + isec)%pot%set(1)%gal21%a43 = rvalues(3)
1617 nonbonded%pot(start + isec)%pot%set(1)%gal21%AO1 = rvalues(1)
1618 nonbonded%pot(start + isec)%pot%set(1)%gal21%AO2 = rvalues(2)
1621 nonbonded%pot(start + isec)%pot%set(1)%gal21%BO1 = rvalues(1)
1622 nonbonded%pot(start + isec)%pot%set(1)%gal21%BO2 = rvalues(2)
1625 r_val=nonbonded%pot(start + isec)%pot%set(1)%gal21%c)
1628 nonbonded%pot(start + isec)%pot%set(1)%gal21%AH1 = rvalues(1)
1629 nonbonded%pot(start + isec)%pot%set(1)%gal21%AH2 = rvalues(2)
1632 nonbonded%pot(start + isec)%pot%set(1)%gal21%BH1 = rvalues(1)
1633 nonbonded%pot(start + isec)%pot%set(1)%gal21%BH2 = rvalues(2)
1638 ALLOCATE (nonbonded%pot(start + isec)%pot%set(1)%gal21%gcn(nval))
1645 nonbonded%pot(start + isec)%pot%set(1)%gal21%gcn(iatom) = rval
1649 l_val=nonbonded%pot(start + isec)%pot%set(1)%gal21%express)
1653 IF (n_rep == 1)
THEN
1655 nonbonded%pot(start + isec)%pot%rcutsq = rcut**2
1656 nonbonded%pot(start + isec)%pot%set(1)%gal21%rcutsq = rcut**2
1659 END SUBROUTINE read_gal21_section
1669 SUBROUTINE read_siepmann_section(nonbonded, section, start, siepmann_section)
1672 INTEGER,
INTENT(IN) :: start
1675 CHARACTER(LEN=default_string_length), &
1676 DIMENSION(:),
POINTER :: atm_names
1677 INTEGER :: isec, n_items, n_rep
1678 REAL(kind=
dp) :: rcut
1681 DO isec = 1, n_items
1686 nonbonded%pot(start + isec)%pot%at1 = atm_names(1)
1687 nonbonded%pot(start + isec)%pot%at2 = atm_names(2)
1688 CALL uppercase(nonbonded%pot(start + isec)%pot%at1)
1689 CALL uppercase(nonbonded%pot(start + isec)%pot%at2)
1692 r_val=nonbonded%pot(start + isec)%pot%set(1)%siepmann%B)
1694 r_val=nonbonded%pot(start + isec)%pot%set(1)%siepmann%D)
1696 r_val=nonbonded%pot(start + isec)%pot%set(1)%siepmann%E)
1698 r_val=nonbonded%pot(start + isec)%pot%set(1)%siepmann%F)
1700 r_val=nonbonded%pot(start + isec)%pot%set(1)%siepmann%beta)
1702 l_val=nonbonded%pot(start + isec)%pot%set(1)%siepmann%allow_oh_formation)
1704 l_val=nonbonded%pot(start + isec)%pot%set(1)%siepmann%allow_h3o_formation)
1706 l_val=nonbonded%pot(start + isec)%pot%set(1)%siepmann%allow_o_formation)
1710 IF (n_rep == 1)
THEN
1712 nonbonded%pot(start + isec)%pot%rcutsq = rcut**2
1713 nonbonded%pot(start + isec)%pot%set(1)%siepmann%rcutsq = rcut**2
1716 END SUBROUTINE read_siepmann_section
1725 SUBROUTINE read_bm_section(nonbonded, section, start)
1728 INTEGER,
INTENT(IN) :: start
1730 CHARACTER(LEN=default_string_length), &
1731 DIMENSION(:),
POINTER :: atm_names
1732 INTEGER :: isec, n_items, n_rep
1733 REAL(kind=
dp) :: a1, a2, b1, b2, beta, c, d, f0, r0, rcut
1736 DO isec = 1, n_items
1750 nonbonded%pot(start + isec)%pot%type =
bm_type
1751 nonbonded%pot(start + isec)%pot%at1 = atm_names(1)
1752 nonbonded%pot(start + isec)%pot%at2 = atm_names(2)
1753 CALL uppercase(nonbonded%pot(start + isec)%pot%at1)
1754 CALL uppercase(nonbonded%pot(start + isec)%pot%at2)
1755 nonbonded%pot(start + isec)%pot%set(1)%buckmo%f0 = f0
1756 nonbonded%pot(start + isec)%pot%set(1)%buckmo%a1 = a1
1757 nonbonded%pot(start + isec)%pot%set(1)%buckmo%a2 = a2
1758 nonbonded%pot(start + isec)%pot%set(1)%buckmo%b1 = b1
1759 nonbonded%pot(start + isec)%pot%set(1)%buckmo%b2 = b2
1760 nonbonded%pot(start + isec)%pot%set(1)%buckmo%c = c
1761 nonbonded%pot(start + isec)%pot%set(1)%buckmo%d = d
1762 nonbonded%pot(start + isec)%pot%set(1)%buckmo%r0 = r0
1763 nonbonded%pot(start + isec)%pot%set(1)%buckmo%beta = beta
1764 nonbonded%pot(start + isec)%pot%rcutsq = rcut*rcut
1768 r_val=nonbonded%pot(start + isec)%pot%set(1)%rmin)
1771 r_val=nonbonded%pot(start + isec)%pot%set(1)%rmax)
1773 END SUBROUTINE read_bm_section
1784 SUBROUTINE read_tabpot_section(nonbonded, section, start, para_env, mm_section)
1787 INTEGER,
INTENT(IN) :: start
1791 CHARACTER(LEN=default_string_length), &
1792 DIMENSION(:),
POINTER :: atm_names
1793 INTEGER :: isec, n_items
1796 DO isec = 1, n_items
1798 nonbonded%pot(start + isec)%pot%type =
tab_type
1799 nonbonded%pot(start + isec)%pot%at1 = atm_names(1)
1800 nonbonded%pot(start + isec)%pot%at2 = atm_names(2)
1801 CALL uppercase(nonbonded%pot(start + isec)%pot%at1)
1802 CALL uppercase(nonbonded%pot(start + isec)%pot%at2)
1804 c_val=nonbonded%pot(start + isec)%pot%set(1)%tab%tabpot_file_name)
1805 CALL read_tabpot_data(nonbonded%pot(start + isec)%pot%set(1)%tab, para_env, mm_section)
1806 nonbonded%pot(start + isec)%pot%set(1)%tab%index = isec
1808 END SUBROUTINE read_tabpot_section
1819 CHARACTER(LEN=default_string_length), &
1820 DIMENSION(:),
POINTER :: charge_atm
1821 REAL(kind=
dp),
DIMENSION(:),
POINTER :: charge
1823 INTEGER,
INTENT(IN) :: start
1825 CHARACTER(LEN=default_string_length) :: atm_name
1826 INTEGER :: isec, n_items
1829 DO isec = 1, n_items
1831 charge_atm(start + isec) = atm_name
1832 CALL uppercase(charge_atm(start + isec))
1846 SUBROUTINE read_apol_section(apol_atm, apol, damping_list, section, &
1848 CHARACTER(LEN=default_string_length), &
1849 DIMENSION(:),
POINTER :: apol_atm
1850 REAL(kind=
dp),
DIMENSION(:),
POINTER :: apol
1853 INTEGER,
INTENT(IN) :: start
1855 CHARACTER(LEN=default_string_length) :: atm_name
1856 INTEGER :: isec, isec_damp, n_damp, n_items, &
1857 start_damp, tmp_damp
1861 NULLIFY (tmp_section)
1864 DO isec = 1, n_items
1868 n_damp = n_damp + tmp_damp
1872 IF (n_damp > 0)
THEN
1873 ALLOCATE (damping_list(1:n_damp))
1878 DO isec = 1, n_items
1880 apol_atm(start + isec) = atm_name
1887 DO isec_damp = 1, tmp_damp
1888 damping_list(start_damp + isec_damp)%atm_name1 = apol_atm(start + isec)
1891 damping_list(start_damp + isec_damp)%atm_name2 = atm_name
1892 CALL uppercase(damping_list(start_damp + isec_damp)%atm_name2)
1895 damping_list(start_damp + isec_damp)%dtype = atm_name
1896 CALL uppercase(damping_list(start_damp + isec_damp)%dtype)
1899 i_val=damping_list(start_damp + isec_damp)%order)
1901 r_val=damping_list(start_damp + isec_damp)%bij)
1903 r_val=damping_list(start_damp + isec_damp)%cij)
1905 start_damp = start_damp + tmp_damp
1909 END SUBROUTINE read_apol_section
1919 SUBROUTINE read_cpol_section(cpol_atm, cpol, section, start)
1920 CHARACTER(LEN=default_string_length), &
1921 DIMENSION(:),
POINTER :: cpol_atm
1922 REAL(kind=
dp),
DIMENSION(:),
POINTER :: cpol
1924 INTEGER,
INTENT(IN) :: start
1926 CHARACTER(LEN=default_string_length) :: atm_name
1927 INTEGER :: isec, n_items
1930 DO isec = 1, n_items
1932 cpol_atm(start + isec) = atm_name
1936 END SUBROUTINE read_cpol_section
1945 SUBROUTINE read_shell_section(shell_list, section, start)
1947 TYPE(
shell_p_type),
DIMENSION(:),
POINTER :: shell_list
1949 INTEGER,
INTENT(IN) :: start
1951 CHARACTER(LEN=default_string_length) :: atm_name
1952 INTEGER :: i_rep, n_rep
1953 REAL(
dp) :: ccharge, cutoff, k, maxdist, mfrac, &
1960 c_val=atm_name, i_rep_section=i_rep)
1962 shell_list(start + i_rep)%atm_name = atm_name
1964 shell_list(start + i_rep)%shell%charge_core = ccharge
1966 shell_list(start + i_rep)%shell%charge_shell = scharge
1968 shell_list(start + i_rep)%shell%massfrac = mfrac
1970 IF (k < 0.0_dp)
THEN
1971 CALL cp_abort(__location__, &
1972 "An invalid value was specified for the force constant k2 of the core-shell "// &
1975 shell_list(start + i_rep)%shell%k2_spring = k
1977 IF (k < 0.0_dp)
THEN
1978 CALL cp_abort(__location__, &
1979 "An invalid value was specified for the force constant k4 of the core-shell "// &
1982 shell_list(start + i_rep)%shell%k4_spring = k
1984 shell_list(start + i_rep)%shell%max_dist = maxdist
1986 shell_list(start + i_rep)%shell%shell_cutoff = cutoff
1989 END SUBROUTINE read_shell_section
2003 SUBROUTINE read_bonds_section(bond_kind, bond_a, bond_b, bond_k, bond_r0, bond_cs, section, start)
2004 INTEGER,
DIMENSION(:),
POINTER :: bond_kind
2005 CHARACTER(LEN=default_string_length), &
2006 DIMENSION(:),
POINTER :: bond_a, bond_b
2007 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: bond_k
2008 REAL(kind=
dp),
DIMENSION(:),
POINTER :: bond_r0, bond_cs
2010 INTEGER,
INTENT(IN) :: start
2012 CHARACTER(LEN=default_string_length), &
2013 DIMENSION(:),
POINTER :: atm_names
2014 INTEGER :: isec, k, n_items
2015 REAL(kind=
dp),
DIMENSION(:),
POINTER :: kvals
2017 NULLIFY (kvals, atm_names)
2019 DO isec = 1, n_items
2022 bond_a(start + isec) = atm_names(1)
2023 bond_b(start + isec) = atm_names(2)
2027 cpassert(
SIZE(kvals) <= 3)
2028 bond_k(:, start + isec) = 0.0_dp
2029 DO k = 1,
SIZE(kvals)
2030 bond_k(k, start + isec) = kvals(k)
2035 END SUBROUTINE read_bonds_section
2056 SUBROUTINE read_bends_section(bend_kind, bend_a, bend_b, bend_c, bend_k, bend_theta0, bend_cb, &
2057 bend_r012, bend_r032, bend_kbs12, bend_kbs32, bend_kss, bend_legendre, &
2059 INTEGER,
DIMENSION(:),
POINTER :: bend_kind
2060 CHARACTER(LEN=default_string_length), &
2061 DIMENSION(:),
POINTER :: bend_a, bend_b, bend_c
2062 REAL(kind=
dp),
DIMENSION(:),
POINTER :: bend_k, bend_theta0, bend_cb, bend_r012, &
2063 bend_r032, bend_kbs12, bend_kbs32, &
2067 INTEGER,
INTENT(IN) :: start
2069 CHARACTER(LEN=default_string_length), &
2070 DIMENSION(:),
POINTER :: atm_names
2071 INTEGER :: isec, k, n_items, n_rep
2072 REAL(kind=
dp),
DIMENSION(:),
POINTER :: kvals, r_values
2074 NULLIFY (kvals, atm_names)
2076 bend_legendre%order = 0
2077 DO isec = 1, n_items
2080 bend_a(start + isec) = atm_names(1)
2081 bend_b(start + isec) = atm_names(2)
2082 bend_c(start + isec) = atm_names(3)
2087 cpassert(
SIZE(kvals) == 1)
2088 bend_k(start + isec) = kvals(1)
2089 CALL section_vals_val_get(section,
"THETA0", i_rep_section=isec, r_val=bend_theta0(start + isec))
2093 CALL section_vals_val_get(section,
"KBS12", i_rep_section=isec, r_val=bend_kbs12(start + isec))
2094 CALL section_vals_val_get(section,
"KBS32", i_rep_section=isec, r_val=bend_kbs32(start + isec))
2099 CALL section_vals_val_get(section,
"LEGENDRE", i_rep_val=k, r_vals=r_values, i_rep_section=isec)
2100 bend_legendre(start + isec)%order =
SIZE(r_values)
2101 IF (
ASSOCIATED(bend_legendre(start + isec)%coeffs))
THEN
2102 DEALLOCATE (bend_legendre(start + isec)%coeffs)
2104 ALLOCATE (bend_legendre(start + isec)%coeffs(bend_legendre(start + isec)%order))
2105 bend_legendre(start + isec)%coeffs = r_values
2108 END SUBROUTINE read_bends_section
2121 SUBROUTINE read_ubs_section(ub_kind, ub_a, ub_b, ub_c, ub_k, ub_r0, section, start)
2122 INTEGER,
DIMENSION(:),
POINTER :: ub_kind
2123 CHARACTER(LEN=default_string_length), &
2124 DIMENSION(:),
POINTER :: ub_a, ub_b, ub_c
2125 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: ub_k
2126 REAL(kind=
dp),
DIMENSION(:),
POINTER :: ub_r0
2128 INTEGER,
INTENT(IN) :: start
2130 CHARACTER(LEN=default_string_length), &
2131 DIMENSION(:),
POINTER :: atm_names
2132 INTEGER :: isec, k, n_items
2134 REAL(kind=
dp),
DIMENSION(:),
POINTER :: kvals
2139 DO isec = 1, n_items
2145 ub_a(start + isec) = atm_names(1)
2146 ub_b(start + isec) = atm_names(2)
2147 ub_c(start + isec) = atm_names(3)
2152 cpassert(
SIZE(kvals) <= 3)
2153 ub_k(:, start + isec) = 0.0_dp
2154 DO k = 1,
SIZE(kvals)
2155 ub_k(k, start + isec) = kvals(k)
2160 END SUBROUTINE read_ubs_section
2176 SUBROUTINE read_torsions_section(torsion_kind, torsion_a, torsion_b, torsion_c, torsion_d, torsion_k, &
2177 torsion_phi0, torsion_m, section, start)
2178 INTEGER,
DIMENSION(:),
POINTER :: torsion_kind
2179 CHARACTER(LEN=default_string_length), &
2180 DIMENSION(:),
POINTER :: torsion_a, torsion_b, torsion_c, &
2182 REAL(kind=
dp),
DIMENSION(:),
POINTER :: torsion_k, torsion_phi0
2183 INTEGER,
DIMENSION(:),
POINTER :: torsion_m
2185 INTEGER,
INTENT(IN) :: start
2187 CHARACTER(LEN=default_string_length), &
2188 DIMENSION(:),
POINTER :: atm_names
2189 INTEGER :: isec, n_items
2193 DO isec = 1, n_items
2194 CALL section_vals_val_get(section,
"KIND", i_rep_section=isec, i_val=torsion_kind(start + isec))
2196 torsion_a(start + isec) = atm_names(1)
2197 torsion_b(start + isec) = atm_names(2)
2198 torsion_c(start + isec) = atm_names(3)
2199 torsion_d(start + isec) = atm_names(4)
2205 CALL section_vals_val_get(section,
"PHI0", i_rep_section=isec, r_val=torsion_phi0(start + isec))
2208 IF (torsion_kind(start + isec) ==
do_ff_opls)
THEN
2209 IF (torsion_phi0(start + isec) /= 0.0_dp)
THEN
2210 CALL cp_warn(__location__,
"PHI0 parameter was non-zero "// &
2211 "for an OPLS-type TORSION. It will be ignored.")
2213 IF (
modulo(torsion_m(start + isec), 2) == 0)
THEN
2215 torsion_phi0(start + isec) =
pi
2218 torsion_k(start + isec) = torsion_k(start + isec)*0.5_dp
2221 END SUBROUTINE read_torsions_section
2236 SUBROUTINE read_improper_section(impr_kind, impr_a, impr_b, impr_c, impr_d, impr_k, &
2237 impr_phi0, section, start)
2238 INTEGER,
DIMENSION(:),
POINTER :: impr_kind
2239 CHARACTER(LEN=default_string_length), &
2240 DIMENSION(:),
POINTER :: impr_a, impr_b, impr_c, impr_d
2241 REAL(kind=
dp),
DIMENSION(:),
POINTER :: impr_k, impr_phi0
2243 INTEGER,
INTENT(IN) :: start
2245 CHARACTER(LEN=default_string_length), &
2246 DIMENSION(:),
POINTER :: atm_names
2247 INTEGER :: isec, n_items
2251 DO isec = 1, n_items
2254 impr_a(start + isec) = atm_names(1)
2255 impr_b(start + isec) = atm_names(2)
2256 impr_c(start + isec) = atm_names(3)
2257 impr_d(start + isec) = atm_names(4)
2265 END SUBROUTINE read_improper_section
2280 SUBROUTINE read_opbend_section(opbend_kind, opbend_a, opbend_b, opbend_c, opbend_d, opbend_k, &
2281 opbend_phi0, section, start)
2282 INTEGER,
DIMENSION(:),
POINTER :: opbend_kind
2283 CHARACTER(LEN=default_string_length), &
2284 DIMENSION(:),
POINTER :: opbend_a, opbend_b, opbend_c, opbend_d
2285 REAL(kind=
dp),
DIMENSION(:),
POINTER :: opbend_k, opbend_phi0
2287 INTEGER,
INTENT(IN) :: start
2289 CHARACTER(LEN=default_string_length), &
2290 DIMENSION(:),
POINTER :: atm_names
2291 INTEGER :: isec, n_items
2295 DO isec = 1, n_items
2296 CALL section_vals_val_get(section,
"KIND", i_rep_section=isec, i_val=opbend_kind(start + isec))
2298 opbend_a(start + isec) = atm_names(1)
2299 opbend_b(start + isec) = atm_names(2)
2300 opbend_c(start + isec) = atm_names(3)
2301 opbend_d(start + isec) = atm_names(4)
2307 CALL section_vals_val_get(section,
"PHI0", i_rep_section=isec, r_val=opbend_phi0(start + isec))
2309 END SUBROUTINE read_opbend_section
2328 NULLIFY (ff_section)
2330 CALL read_force_field_section1(ff_section, mm_section, ff_type, para_env)
2339 SUBROUTINE read_eam_data(eam, para_env, mm_section)
2344 CHARACTER(len=*),
PARAMETER :: routinen =
'read_eam_data'
2346 INTEGER :: handle, i, iw
2350 CALL timeset(routinen, handle)
2355 IF (iw > 0)
WRITE (iw, *)
"Reading EAM data from: ", trim(eam%eam_file_name)
2356 CALL parser_create(parser, trim(eam%eam_file_name), para_env=para_env)
2359 IF (iw > 0)
WRITE (iw, *)
"Title: ", parser%input_line
2362 READ (parser%input_line, *) eam%drar, eam%drhoar, eam%acutal, eam%npoints
2375 DO i = 1, eam%npoints
2377 READ (parser%input_line, *) eam%rho(i), eam%rhop(i)
2379 eam%rval(i) = real(i - 1, kind=
dp)*eam%drar
2380 eam%rhoval(i) = real(i - 1, kind=
dp)*eam%drhoar
2383 DO i = 1, eam%npoints
2385 READ (parser%input_line, *) eam%phi(i), eam%phip(i)
2390 DO i = 1, eam%npoints
2392 READ (parser%input_line, *) eam%frho(i), eam%frhop(i)
2397 IF (iw > 0)
WRITE (iw, *)
"Finished EAM data"
2400 CALL timestop(handle)
2402 END SUBROUTINE read_eam_data
2409 SUBROUTINE read_nequip_data(nequip)
2412 CHARACTER(LEN=*),
PARAMETER :: routinen =
'read_nequip_data'
2414 CHARACTER(LEN=100),
ALLOCATABLE,
DIMENSION(:) :: tokenized_string
2415 CHARACTER(LEN=4000) :: cutoff_matrix_str
2416 CHARACTER(LEN=default_path_length) :: allow_tf32_str, cutoff_str, model_dtype, &
2417 num_types_str, types_str
2418 INTEGER :: handle, i, j, k, len_path
2419 LOGICAL :: allow_tf32, found_model_file
2420 REAL(kind=
dp) :: cut_val
2422 CALL timeset(routinen, handle)
2424 INQUIRE (file=nequip%pot_file_name, exist=found_model_file)
2425 IF (.NOT. found_model_file)
THEN
2426 CALL cp_abort(__location__, &
2427 "Nequip model file <"//trim(nequip%pot_file_name)// &
2431 len_path = len_trim(nequip%pot_file_name)
2432 IF (len_path >= 4)
THEN
2433 IF (nequip%pot_file_name(len_path - 3:len_path) ==
".pt2")
THEN
2434 CALL cp_abort(__location__, &
2435 "AOT compiled models (.pt2) are not yet supported in CP2K. " &
2436 //
"Please use TorchScript (.pth or .pt) models compiled with nequip-compile.")
2441 READ (num_types_str, *) nequip%num_types
2444 CALL tokenize_string(trim(types_str), tokenized_string)
2446 IF (
SIZE(tokenized_string) /= nequip%num_types)
THEN
2447 CALL cp_abort(__location__, &
2448 "NequIP Metadata Error: 'num_types' does not match count of 'type_names'")
2451 IF (
ALLOCATED(nequip%type_names_torch))
THEN
2452 DEALLOCATE (nequip%type_names_torch)
2454 ALLOCATE (nequip%type_names_torch(
SIZE(tokenized_string)))
2455 nequip%type_names_torch(:) = tokenized_string(:)
2457 IF (
ALLOCATED(nequip%cutoff_matrix))
DEALLOCATE (nequip%cutoff_matrix)
2458 ALLOCATE (nequip%cutoff_matrix(nequip%num_types, nequip%num_types))
2460 READ (cutoff_str, *) nequip%rcutsq
2462 nequip%rcutsq = nequip%rcutsq*nequip%rcutsq
2463 nequip%unit_length_val =
cp_unit_to_cp2k(nequip%unit_length_val, nequip%unit_length)
2464 nequip%unit_forces_val =
cp_unit_to_cp2k(nequip%unit_forces_val, nequip%unit_forces)
2465 nequip%unit_energy_val =
cp_unit_to_cp2k(nequip%unit_energy_val, nequip%unit_energy)
2469 IF (len_trim(cutoff_matrix_str) > 0)
THEN
2470 CALL tokenize_string(trim(cutoff_matrix_str), tokenized_string)
2472 IF (
SIZE(tokenized_string) /= nequip%num_types**2)
THEN
2473 CALL cp_abort(__location__,
"per_edge_type_cutoff size does not match num_types^2")
2477 DO i = 1, nequip%num_types
2478 DO j = 1, nequip%num_types
2480 READ (tokenized_string(k), *) cut_val
2482 nequip%cutoff_matrix(i, j) = cut_val*cut_val
2487 nequip%cutoff_matrix(:, :) = nequip%rcutsq
2491 IF (trim(model_dtype) ==
"float32")
THEN
2492 nequip%mixed_precision = .true.
2493 ELSE IF (trim(model_dtype) ==
"float64")
THEN
2494 nequip%mixed_precision = .false.
2498 allow_tf32 = (trim(allow_tf32_str) ==
"1")
2499 IF (trim(allow_tf32_str) /=
"1" .AND. trim(allow_tf32_str) /=
"0")
THEN
2500 CALL cp_abort(__location__, &
2501 "The value for allow_tf32 <"//trim(allow_tf32_str)// &
2502 "> is not supported. Check the .yaml and .pth files.")
2506 CALL timestop(handle)
2507 END SUBROUTINE read_nequip_data
2515 SUBROUTINE tokenize_string(element, tokenized_array)
2516 CHARACTER(LEN=*),
INTENT(IN) :: element
2517 CHARACTER(LEN=100),
ALLOCATABLE,
DIMENSION(:), &
2518 INTENT(OUT) :: tokenized_array
2520 CHARACTER(LEN=1) :: ch
2521 CHARACTER(LEN=100) :: current
2524 l = len_trim(element)
2531 IF ((ch >=
'A' .AND. ch <=
'Z') .OR. (ch >=
'a' .AND. ch <=
'z'))
THEN
2532 current(len_trim(current) + 1:len_trim(current) + 1) = ch
2534 IF (len_trim(current) > 0)
THEN
2540 IF (len_trim(current) > 0) n = n + 1
2542 ALLOCATE (tokenized_array(n))
2548 IF ((ch >=
'A' .AND. ch <=
'Z') .OR. (ch >=
'a' .AND. ch <=
'z'))
THEN
2549 current(len_trim(current) + 1:len_trim(current) + 1) = ch
2551 IF (len_trim(current) > 0)
THEN
2553 tokenized_array(n) = trim(current)
2558 IF (len_trim(current) > 0)
THEN
2560 tokenized_array(n) = trim(current)
2562 END SUBROUTINE tokenize_string
2570 SUBROUTINE check_cp2k_atom_names_in_torch(cp2k_inp_atom_types, torch_atom_types)
2571 CHARACTER(LEN=*),
DIMENSION(:),
INTENT(IN) :: cp2k_inp_atom_types, torch_atom_types
2574 LOGICAL :: found_atom
2576 DO i = 1,
SIZE(cp2k_inp_atom_types)
2577 found_atom = .false.
2578 DO j = 1,
SIZE(torch_atom_types)
2579 IF (trim(cp2k_inp_atom_types(i)) == trim(torch_atom_types(j)))
THEN
2584 IF (.NOT. found_atom)
THEN
2585 CALL cp_abort(__location__, &
2586 "Atom "//trim(cp2k_inp_atom_types(i))// &
2587 " is defined in the CP2K input file but is missing in the torch model file")
2590 END SUBROUTINE check_cp2k_atom_names_in_torch
2599 SUBROUTINE read_tabpot_data(tab, para_env, mm_section)
2604 CHARACTER(len=*),
PARAMETER :: routinen =
'read_tabpot_data'
2607 INTEGER :: d, handle, i, iw
2611 CALL timeset(routinen, handle)
2616 IF (iw > 0)
WRITE (iw, *)
"Reading TABPOT data from: ", trim(tab%tabpot_file_name)
2617 CALL parser_create(parser, trim(tab%tabpot_file_name), para_env=para_env)
2619 IF (iw > 0)
WRITE (iw, *)
"Title: ", parser%input_line
2624 READ (parser%input_line, *) d1, tab%npoints, d2, tab%dr, tab%rcut
2632 DO i = 1, tab%npoints
2634 READ (parser%input_line, *) d, tab%r(i), tab%e(i), tab%f(i)
2640 tab%dr = tab%r(2) - tab%r(1)
2643 IF (iw > 0)
WRITE (iw, *)
"Finished TABPOT data"
2646 CALL timestop(handle)
2647 END SUBROUTINE read_tabpot_data
static GRID_HOST_DEVICE int modulo(int a, int m)
Equivalent of Fortran's MODULO, which always return a positive number. https://gcc....
Interface to ACE C wrapper.
subroutine, public ace_model_initialize(ntypec, symbolc, fname, rcutc, model)
...
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public tosi1964b
integer, save, public tersoff1988
integer, save, public tosi1964a
integer, save, public siepmann1995
integer, save, public yamada2000
integer, save, public clabaut2021
integer, save, public clabaut2020
Utility routines to open and close files. Tracking of preconnections.
character(len=default_path_length) function, public discover_file(file_name)
Checks various locations for a file name.
various routines to log and control the output. The idea is that decisions about where to log should ...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
Utility routines to read data from files. Kept as close as possible to the old parser because.
subroutine, public parser_get_next_line(parser, nline, at_end)
Read the next input line and broadcast the input information. Skip (nline-1) lines and skip also all ...
Utility routines to read data from files. Kept as close as possible to the old parser because.
subroutine, public parser_release(parser)
releases the parser
subroutine, public parser_create(parser, file_name, unit_nr, para_env, end_section_label, separator_chars, comment_char, continuation_char, quote_char, section_char, parse_white_lines, initial_variables, apply_preprocessing)
Start a parser run. Initial variables allow to @SET stuff before opening the file.
real(kind=dp) function, public cp_unit_to_cp2k(value, unit_str, defaults, power)
converts to the internal cp2k units to the given unit
Define all structure types related to force field kinds.
integer, parameter, public do_ff_undef
integer, parameter, public do_ff_charmm
integer, parameter, public do_ff_g87
integer, parameter, public do_ff_g96
integer, parameter, public do_ff_amber
integer, parameter, public do_ff_opls
Define all structures types related to force_fields.
subroutine, public get_generic_info(gen_section, func_name, xfunction, parameters, values, var_values, size_variables, i_rep_sec, input_variables)
Reads from the input structure all information for generic functions.
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
integer, parameter, public default_path_length
An array-based list which grows on demand. When the internal array is full, a new array of twice the ...
Definition of mathematical constants and functions.
real(kind=dp), parameter, public pi
Collection of simple mathematical functions and subroutines.
Utility routines for the memory handling.
Interface to the message passing library MPI.
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
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
integer, parameter, public deepmd_type
integer, parameter, public gp_type
integer, parameter, public siepmann_type
integer, parameter, public ace_type
integer, dimension(2), parameter, public do_potential_single_allocation
integer, parameter, public gw_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
subroutine, public shell_p_create(shell_list, ndim)
...
Utilities for string manipulations.
elemental subroutine, public uppercase(string)
Convert all lower case characters in a string to upper case.
subroutine, public torch_allow_tf32(allow_tf32)
Set whether to allow the use of TF32. Needed due to changes in defaults from pytorch 1....
character(:) function, allocatable, public torch_model_read_metadata(filename, key)
Reads metadata entry from given "*.pth" file. (In Torch lingo they are called extra files)
type of a logger, at the moment it contains just a print level starting at which level it should be l...
stores all the informations relevant to an mpi environment