85 atomic_energy, atomic_virial)
88 REAL(kind=
dp),
DIMENSION(natom, 3),
INTENT(IN) :: coord
89 INTEGER,
DIMENSION(natom),
INTENT(IN) :: atype
90 REAL(kind=
dp),
DIMENSION(9),
INTENT(IN) :: cell
91 REAL(kind=
dp),
INTENT(OUT) :: energy
92 REAL(kind=
dp),
DIMENSION(natom, 3),
INTENT(OUT) :: force
93 REAL(kind=
dp),
DIMENSION(9),
INTENT(OUT) :: virial
94 REAL(kind=
dp),
DIMENSION(natom),
INTENT(OUT) :: atomic_energy
95 REAL(kind=
dp),
DIMENSION(natom, 9),
INTENT(OUT) :: atomic_virial
97 CHARACTER(LEN=*),
PARAMETER :: routinen =
'deepmd_model_compute'
101 SUBROUTINE deeppotcompute(model, natom, coord, atype, cell, energy, force, virial, &
102 atomic_energy, atomic_virial)
BIND(C, name="DP_DeepPotCompute")
103 IMPORT :: c_ptr, c_int, c_double
104 TYPE(c_ptr),
VALUE :: model
105 INTEGER(C_INT),
VALUE :: natom
106 REAL(c_double),
DIMENSION(natom, 3) :: coord
107 INTEGER(C_INT),
DIMENSION(natom) :: atype
108 REAL(c_double),
DIMENSION(9) :: cell
109 REAL(c_double) :: energy
110 REAL(c_double),
DIMENSION(natom, 3) :: force
111 REAL(c_double),
DIMENSION(9) :: virial
112 REAL(c_double),
DIMENSION(natom) :: atomic_energy
113 REAL(c_double),
DIMENSION(natom, 9) :: atomic_virial
117 CALL timeset(routinen, handle)
120 CALL deeppotcompute(model=model%c_ptr, &
128 atomic_energy=atomic_energy, &
129 atomic_virial=atomic_virial)
131 cpabort(
"CP2K was compiled without libdeepmd_c library.")
140 mark_used(atomic_energy)
141 mark_used(atomic_virial)
144 CALL timestop(handle)
subroutine, public deepmd_model_compute(model, natom, coord, atype, cell, energy, force, virial, atomic_energy, atomic_virial)
Compute energy, force and virial from DP.