(git:419edc0)
Loading...
Searching...
No Matches
sirius_interface.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2025 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8!***************************************************************************************************
9!> \brief Interface to the SIRIUS Library
10!> \par History
11!> 07.2018 initial create
12!> \author JHU
13!***************************************************************************************************
14#if defined(__SIRIUS)
16 USE iso_c_binding, ONLY: c_double,&
17 c_int,&
18 c_loc
22 USE atom_upf, ONLY: atom_upfpot_type
26 USE cell_types, ONLY: cell_type,&
31 USE cp_output_handling, ONLY: cp_p_file,&
45 USE kinds, ONLY: default_string_length,&
46 dp
47 USE machine, ONLY: m_flush
48 USE mathconstants, ONLY: fourpi,&
49 gamma1
52 USE physcon, ONLY: massunit
61 USE qs_kind_types, ONLY: get_qs_kind,&
65 USE sirius, ONLY: &
66 sirius_integer_array_type, sirius_integer_type, sirius_logical_array_type, &
67 sirius_logical_type, sirius_number_array_type, sirius_number_type, &
68 sirius_string_array_type, sirius_string_type, sirius_add_atom, sirius_add_atom_type, &
69 sirius_add_atom_type_radial_function, sirius_add_xc_functional, sirius_context_handler, &
70 sirius_create_context, sirius_create_ground_state, sirius_create_kset_from_grid, &
71 sirius_finalize, sirius_find_ground_state, sirius_get_band_energies, &
72 sirius_get_band_occupancies, sirius_get_energy, sirius_get_forces, &
73 sirius_get_kpoint_properties, sirius_get_num_kpoints, sirius_get_parameters, &
74 sirius_get_stress_tensor, sirius_ground_state_handler, sirius_import_parameters, &
75 sirius_initialize, sirius_initialize_context, sirius_kpoint_set_handler, &
76 sirius_option_get_info, sirius_option_get_section_length, sirius_option_set, &
77 sirius_set_atom_position, sirius_set_atom_type_dion, sirius_set_atom_type_hubbard, &
78 sirius_set_atom_type_radial_grid, sirius_set_lattice_vectors, sirius_set_mpi_grid_dims, &
79 sirius_update_ground_state
80#include "./base/base_uses.f90"
81
82 IMPLICIT NONE
83
84 PRIVATE
85
86! *** Global parameters ***
87
88 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'sirius_interface'
89
90! *** Public subroutines ***
91
94
95CONTAINS
96
97!***************************************************************************************************
98!> \brief ...
99!> \param
100!> \par History
101!> 07.2018 start the Sirius library
102!> \author JHU
103! **************************************************************************************************
104 SUBROUTINE cp_sirius_init()
105 CALL sirius_initialize(.false.)
106 END SUBROUTINE cp_sirius_init
107
108!***************************************************************************************************
109!> \brief ...
110!> \param
111!> \par History
112!> 07.2018 stop the Sirius library
113!> \author JHU
114! **************************************************************************************************
115 SUBROUTINE cp_sirius_finalize()
116 CALL sirius_finalize(.false., .false., .false.)
117 END SUBROUTINE cp_sirius_finalize
118
119!***************************************************************************************************
120!> \brief ...
121!> \param pwdft_env ...
122!> \param
123!> \par History
124!> 07.2018 Create the Sirius environment
125!> \author JHU
126! **************************************************************************************************
127 SUBROUTINE cp_sirius_create_env(pwdft_env)
128 TYPE(pwdft_environment_type), POINTER :: pwdft_env
129#if defined(__SIRIUS)
130
131 CHARACTER(len=2) :: element_symbol
132 CHARACTER(len=default_string_length) :: label
133 INTEGER :: i, iatom, ibeta, ifun, ikind, iwf, j, l, &
134 n, natom, nbeta, nkind, nmesh, &
135 num_mag_dims, sirius_mpi_comm, vdw_func, nu, lu, output_unit
136 INTEGER, DIMENSION(:), POINTER :: mpi_grid_dims
137 INTEGER(KIND=C_INT), DIMENSION(3) :: k_grid, k_shift
138 INTEGER, DIMENSION(:), POINTER :: kk
139 LOGICAL :: up, use_ref_cell
140 LOGICAL(4) :: use_so, use_symmetry, dft_plus_u_atom
141 REAL(KIND=c_double), ALLOCATABLE, DIMENSION(:) :: fun
142 REAL(KIND=c_double), ALLOCATABLE, DIMENSION(:, :) :: dion
143 REAL(KIND=c_double), DIMENSION(3) :: a1, a2, a3, v1, v2
144 REAL(KIND=dp) :: al, angle1, angle2, cval, focc, &
145 magnetization, mass, pf, rl, zeff, alpha_u, beta_u, &
146 j0_u, j_u, u_u, occ_u, u_minus_j
147 REAL(KIND=dp), ALLOCATABLE, DIMENSION(:) :: beta, corden, ef, fe, locpot, rc, rp
148 REAL(KIND=dp), DIMENSION(3) :: vr, vs, j_t
149 REAL(KIND=dp), DIMENSION(:), POINTER :: density
150 REAL(KIND=dp), DIMENSION(:, :), POINTER :: wavefunction, wfninfo
151 TYPE(atom_gthpot_type), POINTER :: gth_atompot
152 TYPE(atom_upfpot_type), POINTER :: upf_pot
153 TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
154 TYPE(atomic_kind_type), POINTER :: atomic_kind
155 TYPE(cell_type), POINTER :: my_cell
156 TYPE(mp_para_env_type), POINTER :: para_env
157 TYPE(grid_atom_type), POINTER :: atom_grid
158 TYPE(gth_potential_type), POINTER :: gth_potential
159 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
160 TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set
161 TYPE(qs_subsys_type), POINTER :: qs_subsys
162 TYPE(section_vals_type), POINTER :: pwdft_section, pwdft_sub_section, &
163 xc_fun, xc_section
164 TYPE(sirius_context_handler) :: sctx
165 TYPE(sirius_ground_state_handler) :: gs_handler
166 TYPE(sirius_kpoint_set_handler) :: ks_handler
167
168 cpassert(ASSOCIATED(pwdft_env))
169
170 output_unit = cp_logger_get_default_io_unit()
171 ! create context of simulation
172 CALL pwdft_env_get(pwdft_env, para_env=para_env)
173 sirius_mpi_comm = para_env%get_handle()
174 CALL sirius_create_context(sirius_mpi_comm, sctx)
175
176! the "fun" starts.
177
178 CALL pwdft_env_get(pwdft_env=pwdft_env, pwdft_input=pwdft_section, xc_input=xc_section)
179
180 CALL section_vals_val_get(pwdft_section, "ignore_convergence_failure", &
181 l_val=pwdft_env%ignore_convergence_failure)
182 ! cp2k should *have* a function that return all xc_functionals. Doing
183 ! manually is prone to errors
184
185 IF (ASSOCIATED(xc_section)) THEN
186 ifun = 0
187 DO
188 ifun = ifun + 1
189 xc_fun => section_vals_get_subs_vals2(xc_section, i_section=ifun)
190 IF (.NOT. ASSOCIATED(xc_fun)) EXIT
191 ! Here, we do not have to check whether the functional name starts with XC_
192 ! because we only allow the shorter form w/o XC_
193 CALL sirius_add_xc_functional(sctx, "XC_"//trim(xc_fun%section%name))
194 END DO
195 END IF
196
197 ! import control section
198 pwdft_sub_section => section_vals_get_subs_vals(pwdft_section, "control")
199 IF (ASSOCIATED(pwdft_sub_section)) THEN
200 CALL cp_sirius_fill_in_section(sctx, pwdft_sub_section, "control")
201 CALL section_vals_val_get(pwdft_sub_section, "mpi_grid_dims", i_vals=mpi_grid_dims)
202 END IF
203
204! import parameters section
205 pwdft_sub_section => section_vals_get_subs_vals(pwdft_section, "parameters")
206
207 IF (ASSOCIATED(pwdft_sub_section)) THEN
208 CALL cp_sirius_fill_in_section(sctx, pwdft_sub_section, "parameters")
209 CALL section_vals_val_get(pwdft_sub_section, "ngridk", i_vals=kk)
210 k_grid(1) = kk(1)
211 k_grid(2) = kk(2)
212 k_grid(3) = kk(3)
213
214 CALL section_vals_val_get(pwdft_sub_section, "shiftk", i_vals=kk)
215 k_shift(1) = kk(1)
216 k_shift(2) = kk(2)
217 k_shift(3) = kk(3)
218 CALL section_vals_val_get(pwdft_sub_section, "num_mag_dims", i_val=num_mag_dims)
219 CALL section_vals_val_get(pwdft_sub_section, "use_symmetry", l_val=use_symmetry)
220 CALL section_vals_val_get(pwdft_sub_section, "so_correction", l_val=use_so)
221
222! now check if van der walls corrections are needed
223 vdw_func = -1
224#ifdef __LIBVDWXC
225 CALL section_vals_val_get(pwdft_sub_section, "vdw_functional", i_val=vdw_func)
226 SELECT CASE (vdw_func)
227 CASE (sirius_func_vdwdf)
228 CALL sirius_add_xc_functional(sctx, "XC_FUNC_VDWDF")
229 CASE (sirius_func_vdwdf2)
230 CALL sirius_add_xc_functional(sctx, "XC_FUNC_VDWDF2")
232 CALL sirius_add_xc_functional(sctx, "XC_FUNC_VDWDF2")
233 CASE default
234 END SELECT
235#endif
236
237 END IF
238
239! import mixer section
240 pwdft_sub_section => section_vals_get_subs_vals(pwdft_section, "mixer")
241 IF (ASSOCIATED(pwdft_sub_section)) THEN
242 CALL cp_sirius_fill_in_section(sctx, pwdft_sub_section, "mixer")
243 END IF
244
245! import settings section
246 pwdft_sub_section => section_vals_get_subs_vals(pwdft_section, "settings")
247 IF (ASSOCIATED(pwdft_sub_section)) THEN
248 CALL cp_sirius_fill_in_section(sctx, pwdft_sub_section, "settings")
249 END IF
250
251 ! import solver section
252 pwdft_sub_section => section_vals_get_subs_vals(pwdft_section, "iterative_solver")
253 IF (ASSOCIATED(pwdft_sub_section)) THEN
254 CALL cp_sirius_fill_in_section(sctx, pwdft_sub_section, "iterative_solver")
255 END IF
256
257 !
258 ! uncomment these lines when nlcg is officially supported
259 !
260
261 ! import nlcg section
262 ! pwdft_sub_section => section_vals_get_subs_vals(pwdft_section, "nlcg")
263 ! IF (ASSOCIATED(pwdft_sub_section)) THEN
264 ! CALL cp_sirius_fill_in_section(sctx, pwdft_sub_section, "nlcg")
265 ! ENDIF
266
267 !CALL sirius_dump_runtime_setup(sctx, "runtime.json")
268 CALL sirius_import_parameters(sctx, '{}')
269
270! lattice vectors of the unit cell should be in [a.u.] (length is in [a.u.])
271 CALL pwdft_env_get(pwdft_env=pwdft_env, qs_subsys=qs_subsys)
272 CALL qs_subsys_get(qs_subsys, cell=my_cell, use_ref_cell=use_ref_cell)
273 a1(:) = my_cell%hmat(:, 1)
274 a2(:) = my_cell%hmat(:, 2)
275 a3(:) = my_cell%hmat(:, 3)
276 CALL sirius_set_lattice_vectors(sctx, a1(1), a2(1), a3(1))
277
278 IF (use_ref_cell) THEN
279 cpwarn("SIRIUS| The specified CELL_REF will be ignored for PW_DFT calculations")
280 END IF
281
282! set up the atomic type definitions
283 CALL qs_subsys_get(qs_subsys, &
284 atomic_kind_set=atomic_kind_set, &
285 qs_kind_set=qs_kind_set, &
286 particle_set=particle_set)
287 nkind = SIZE(atomic_kind_set)
288 DO ikind = 1, nkind
289 CALL get_atomic_kind(atomic_kind_set(ikind), &
290 name=label, element_symbol=element_symbol, mass=mass)
291 CALL get_qs_kind(qs_kind_set(ikind), zeff=zeff)
292 NULLIFY (upf_pot, gth_potential)
293 CALL get_qs_kind(qs_kind_set(ikind), upf_potential=upf_pot, gth_potential=gth_potential)
294
295 IF (ASSOCIATED(upf_pot)) THEN
296 CALL sirius_add_atom_type(sctx, label, fname=upf_pot%filename, &
297 symbol=element_symbol, &
298 mass=real(mass/massunit, kind=c_double))
299
300 ELSEIF (ASSOCIATED(gth_potential)) THEN
301!
302 NULLIFY (atom_grid)
303 CALL allocate_grid_atom(atom_grid)
304 nmesh = 929
305 atom_grid%nr = nmesh
306 CALL create_grid_atom(atom_grid, nmesh, 1, 1, 0, do_gapw_log)
307 ALLOCATE (rp(nmesh), fun(nmesh))
308 IF (atom_grid%rad(1) < atom_grid%rad(nmesh)) THEN
309 up = .true.
310 ELSE
311 up = .false.
312 END IF
313 IF (up) THEN
314 rp(1:nmesh) = atom_grid%rad(1:nmesh)
315 ELSE
316 DO i = 1, nmesh
317 rp(i) = atom_grid%rad(nmesh - i + 1)
318 END DO
319 END IF
320! add new atom type
321 CALL sirius_add_atom_type(sctx, label, &
322 zn=nint(zeff + 0.001d0), &
323 symbol=element_symbol, &
324 mass=real(mass/massunit, kind=c_double), &
325 spin_orbit=.false.)
326!
327 ALLOCATE (gth_atompot)
328 CALL gth_potential_conversion(gth_potential, gth_atompot)
329! set radial grid
330 fun(1:nmesh) = rp(1:nmesh)
331 CALL sirius_set_atom_type_radial_grid(sctx, label, nmesh, fun(1))
332! set beta-projectors
333 ALLOCATE (ef(nmesh), beta(nmesh))
334 ibeta = 0
335 DO l = 0, 3
336 IF (gth_atompot%nl(l) == 0) cycle
337 rl = gth_atompot%rcnl(l)
338! we need to multiply by r so that data transferred to sirius are r \beta(r) not beta(r)
339 ef(1:nmesh) = exp(-0.5_dp*rp(1:nmesh)*rp(1:nmesh)/(rl*rl))
340 DO i = 1, gth_atompot%nl(l)
341 pf = rl**(l + 0.5_dp*(4._dp*i - 1._dp))
342 j = l + 2*i - 1
343 pf = sqrt(2._dp)/(pf*sqrt(gamma1(j)))
344 beta(:) = pf*rp**(l + 2*i - 2)*ef
345 ibeta = ibeta + 1
346 fun(1:nmesh) = beta(1:nmesh)*rp(1:nmesh)
347 CALL sirius_add_atom_type_radial_function(sctx, label, &
348 "beta", fun(1), nmesh, l=l)
349 END DO
350 END DO
351 DEALLOCATE (ef, beta)
352 nbeta = ibeta
353
354! nonlocal PP matrix elements
355 ALLOCATE (dion(nbeta, nbeta))
356 dion = 0.0_dp
357 DO l = 0, 3
358 IF (gth_atompot%nl(l) == 0) cycle
359 ibeta = sum(gth_atompot%nl(0:l - 1)) + 1
360 i = ibeta + gth_atompot%nl(l) - 1
361 dion(ibeta:i, ibeta:i) = gth_atompot%hnl(1:gth_atompot%nl(l), 1:gth_atompot%nl(l), l)
362 END DO
363 CALL sirius_set_atom_type_dion(sctx, label, nbeta, dion(1, 1))
364 DEALLOCATE (dion)
365
366! set non-linear core correction
367 IF (gth_atompot%nlcc) THEN
368 ALLOCATE (corden(nmesh), fe(nmesh), rc(nmesh))
369 corden(:) = 0.0_dp
370 n = gth_atompot%nexp_nlcc
371 DO i = 1, n
372 al = gth_atompot%alpha_nlcc(i)
373 rc(:) = rp(:)/al
374 fe(:) = exp(-0.5_dp*rc(:)*rc(:))
375 DO j = 1, gth_atompot%nct_nlcc(i)
376 cval = gth_atompot%cval_nlcc(j, i)
377 corden(:) = corden(:) + fe(:)*rc(:)**(2*j - 2)*cval
378 END DO
379 END DO
380 fun(1:nmesh) = corden(1:nmesh)*rp(1:nmesh)
381 CALL sirius_add_atom_type_radial_function(sctx, label, "ps_rho_core", &
382 fun(1), nmesh)
383 DEALLOCATE (corden, fe, rc)
384 END IF
385
386! local potential
387 ALLOCATE (locpot(nmesh))
388 locpot(:) = 0.0_dp
389 CALL atom_local_potential(locpot, gth_atompot, rp)
390 fun(1:nmesh) = locpot(1:nmesh)
391 CALL sirius_add_atom_type_radial_function(sctx, label, "vloc", &
392 fun(1), nmesh)
393 DEALLOCATE (locpot)
394!
395 NULLIFY (density, wavefunction, wfninfo)
396 CALL calculate_atomic_orbitals(atomic_kind_set(ikind), qs_kind_set(ikind), &
397 density=density, wavefunction=wavefunction, &
398 wfninfo=wfninfo, agrid=atom_grid)
399
400! set the atomic radial functions
401 DO iwf = 1, SIZE(wavefunction, 2)
402 focc = wfninfo(1, iwf)
403 l = nint(wfninfo(2, iwf))
404! we can not easily get the principal quantum number
405 nu = -1
406 IF (up) THEN
407 fun(1:nmesh) = wavefunction(1:nmesh, iwf)*rp(i)
408 ELSE
409 DO i = 1, nmesh
410 fun(i) = wavefunction(nmesh - i + 1, iwf)*rp(i)
411 END DO
412 END IF
413 CALL sirius_add_atom_type_radial_function(sctx, &
414 label, "ps_atomic_wf", &
415 fun(1), nmesh, l=l, occ=real(focc, kind=c_double), n=nu)
416 END DO
417
418! set total charge density of a free atom (to compute initial rho(r))
419 IF (up) THEN
420 fun(1:nmesh) = fourpi*density(1:nmesh)*atom_grid%rad(1:nmesh)**2
421 ELSE
422 DO i = 1, nmesh
423 fun(i) = fourpi*density(nmesh - i + 1)*atom_grid%rad(nmesh - i + 1)**2
424 END DO
425 END IF
426 CALL sirius_add_atom_type_radial_function(sctx, label, "ps_rho_total", &
427 fun(1), nmesh)
428
429 IF (ASSOCIATED(density)) DEALLOCATE (density)
430 IF (ASSOCIATED(wavefunction)) DEALLOCATE (wavefunction)
431 IF (ASSOCIATED(wfninfo)) DEALLOCATE (wfninfo)
432
433 CALL deallocate_grid_atom(atom_grid)
434 DEALLOCATE (rp, fun)
435 DEALLOCATE (gth_atompot)
436!
437 ELSE
438 CALL cp_abort(__location__, &
439 "CP2K/SIRIUS: atomic kind needs UPF or GTH potential definition")
440 END IF
441
442 CALL get_qs_kind(qs_kind_set(ikind), &
443 dft_plus_u_atom=dft_plus_u_atom, &
444 l_of_dft_plus_u=lu, &
445 n_of_dft_plus_u=nu, &
446 u_minus_j_target=u_minus_j, &
447 u_of_dft_plus_u=u_u, &
448 j_of_dft_plus_u=j_u, &
449 alpha_of_dft_plus_u=alpha_u, &
450 beta_of_dft_plus_u=beta_u, &
451 j0_of_dft_plus_u=j0_u, &
452 occupation_of_dft_plus_u=occ_u)
453
454 IF (dft_plus_u_atom) THEN
455 IF (nu < 1) THEN
456 cpabort("CP2K/SIRIUS (hubbard): principal quantum number not specified")
457 END IF
458
459 IF (lu < 0) THEN
460 cpabort("CP2K/SIRIUS (hubbard): l can not be negative.")
461 END IF
462
463 IF (occ_u < 0.0) THEN
464 cpabort("CP2K/SIRIUS (hubbard): the occupation number can not be negative.")
465 END IF
466
467 j_t(:) = 0.0
468 IF (abs(u_minus_j) < 1e-8) THEN
469 j_t(1) = j_u
470 CALL sirius_set_atom_type_hubbard(sctx, label, lu, nu, &
471 occ_u, u_u, j_t, alpha_u, beta_u, j0_u)
472 ELSE
473 CALL sirius_set_atom_type_hubbard(sctx, label, lu, nu, &
474 occ_u, u_minus_j, j_t, alpha_u, beta_u, j0_u)
475 END IF
476 END IF
477
478 END DO
479
480! add atoms to the unit cell
481! WARNING: sirius accepts only fractional coordinates;
482 natom = SIZE(particle_set)
483 DO iatom = 1, natom
484 vr(1:3) = particle_set(iatom)%r(1:3)
485 CALL real_to_scaled(vs, vr, my_cell)
486 atomic_kind => particle_set(iatom)%atomic_kind
487 ikind = atomic_kind%kind_number
488 CALL get_atomic_kind(atomic_kind, name=label)
489 CALL get_qs_kind(qs_kind_set(ikind), zeff=zeff, magnetization=magnetization)
490! angle of magnetization might come from input Atom x y z mx my mz
491! or as an angle?
492! Answer : SIRIUS only accept the magnetization as mx, my, mz
493 IF (num_mag_dims .EQ. 3) THEN
494 angle1 = 0.0_dp
495 angle2 = 0.0_dp
496 v1(1) = magnetization*sin(angle1)*cos(angle2)
497 v1(2) = magnetization*sin(angle1)*sin(angle2)
498 v1(3) = magnetization*cos(angle1)
499 ELSE
500 v1 = 0._dp
501 v1(3) = magnetization
502 END IF
503 v2(1:3) = vs(1:3)
504 CALL sirius_add_atom(sctx, label, v2(1), v1(1))
505 END DO
506
507 CALL sirius_set_mpi_grid_dims(sctx, 2, mpi_grid_dims)
508
509! initialize global variables/indices/arrays/etc. of the simulation
510 CALL sirius_initialize_context(sctx)
511
512 ! strictly speaking the parameter use_symmetry is initialized at the
513 ! beginning but it does no harm to do it that way
514 IF (use_symmetry) THEN
515 CALL sirius_create_kset_from_grid(sctx, k_grid(1), k_shift(1), use_symmetry=.true., kset_handler=ks_handler)
516 ELSE
517 CALL sirius_create_kset_from_grid(sctx, k_grid(1), k_shift(1), use_symmetry=.false., kset_handler=ks_handler)
518 END IF
519! create ground-state class
520 CALL sirius_create_ground_state(ks_handler, gs_handler)
521
522 CALL pwdft_env_set(pwdft_env, sctx=sctx, gs_handler=gs_handler, ks_handler=ks_handler)
523#endif
524 END SUBROUTINE cp_sirius_create_env
525
526!***************************************************************************************************
527!> \brief ...
528!> \param pwdft_env ...
529!> \param
530!> \par History
531!> 07.2018 Update the Sirius environment
532!> \author JHU
533! **************************************************************************************************
534 SUBROUTINE cp_sirius_update_context(pwdft_env)
535 TYPE(pwdft_environment_type), POINTER :: pwdft_env
536
537 INTEGER :: iatom, natom
538 REAL(KIND=c_double), DIMENSION(3) :: a1, a2, a3, v2
539 REAL(KIND=dp), DIMENSION(3) :: vr, vs
540 TYPE(cell_type), POINTER :: my_cell
541 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
542 TYPE(qs_subsys_type), POINTER :: qs_subsys
543 TYPE(sirius_context_handler) :: sctx
544 TYPE(sirius_ground_state_handler) :: gs_handler
545
546 cpassert(ASSOCIATED(pwdft_env))
547 CALL pwdft_env_get(pwdft_env, sctx=sctx, gs_handler=gs_handler)
548
549! get current positions and lattice vectors
550 CALL pwdft_env_get(pwdft_env=pwdft_env, qs_subsys=qs_subsys)
551
552! lattice vectors of the unit cell should be in [a.u.] (length is in [a.u.])
553 CALL qs_subsys_get(qs_subsys, cell=my_cell)
554 a1(:) = my_cell%hmat(:, 1)
555 a2(:) = my_cell%hmat(:, 2)
556 a3(:) = my_cell%hmat(:, 3)
557 CALL sirius_set_lattice_vectors(sctx, a1(1), a2(1), a3(1))
558
559! new atomic positions
560 CALL qs_subsys_get(qs_subsys, particle_set=particle_set)
561 natom = SIZE(particle_set)
562 DO iatom = 1, natom
563 vr(1:3) = particle_set(iatom)%r(1:3)
564 CALL real_to_scaled(vs, vr, my_cell)
565 v2(1:3) = vs(1:3)
566 CALL sirius_set_atom_position(sctx, iatom, v2(1))
567 END DO
568
569! update ground-state class
570 CALL sirius_update_ground_state(gs_handler)
571
572 CALL pwdft_env_set(pwdft_env, sctx=sctx, gs_handler=gs_handler)
573
574 END SUBROUTINE cp_sirius_update_context
575
576! **************************************************************************************************
577!> \brief ...
578!> \param sctx ...
579!> \param section ...
580!> \param section_name ...
581! **************************************************************************************************
582 SUBROUTINE cp_sirius_fill_in_section(sctx, section, section_name)
583 TYPE(sirius_context_handler), INTENT(INOUT) :: sctx
584 TYPE(section_vals_type), POINTER :: section
585 CHARACTER(*), INTENT(in) :: section_name
586
587 CHARACTER(len=256), TARGET :: option_name
588 CHARACTER(len=4096) :: description, usage
589 CHARACTER(len=80), DIMENSION(:), POINTER :: tmp
590 CHARACTER(len=80), TARGET :: str
591 INTEGER :: ctype, elem, ic, j
592 INTEGER, DIMENSION(:), POINTER :: ivals
593 INTEGER, TARGET :: enum_length, ival, length, &
594 num_possible_values, number_of_options
595 LOGICAL :: explicit
596 LOGICAL, DIMENSION(:), POINTER :: lvals
597 LOGICAL, TARGET :: found, lval
598 REAL(kind=dp), DIMENSION(:), POINTER :: rvals
599 REAL(kind=dp), TARGET :: rval
600
601 NULLIFY (rvals)
602 NULLIFY (ivals)
603 CALL sirius_option_get_section_length(section_name, number_of_options)
604
605 DO elem = 1, number_of_options
606 option_name = ''
607 CALL sirius_option_get_info(section_name, &
608 elem, &
609 option_name, &
610 256, &
611 ctype, &
612 num_possible_values, &
613 enum_length, &
614 description, &
615 4096, &
616 usage, &
617 4096)
618 IF ((option_name /= 'memory_usage') .AND. (option_name /= 'xc_functionals') .AND. (option_name /= 'vk')) THEN
619 CALL section_vals_val_get(section, option_name, explicit=found)
620 IF (found) THEN
621 SELECT CASE (ctype)
622 CASE (sirius_integer_type)
623 CALL section_vals_val_get(section, option_name, i_val=ival)
624 CALL sirius_option_set(sctx, section_name, option_name, ctype, c_loc(ival))
625 CASE (sirius_number_type)
626 CALL section_vals_val_get(section, option_name, r_val=rval)
627 CALL sirius_option_set(sctx, section_name, option_name, ctype, c_loc(rval))
628 CASE (sirius_logical_type)
629 CALL section_vals_val_get(section, option_name, l_val=lval)
630 CALL sirius_option_set(sctx, section_name, option_name, ctype, c_loc(lval))
631 CASE (sirius_string_type) ! string nightmare
632 str = ''
633 CALL section_vals_val_get(section, option_name, explicit=explicit, c_val=str)
634 str = trim(adjustl(str))
635 DO j = 1, len(str)
636 ic = ichar(str(j:j))
637 IF (ic >= 65 .AND. ic < 90) str(j:j) = char(ic + 32)
638 END DO
639
640 CALL sirius_option_set(sctx, section_name, option_name, ctype, c_loc(str), max_length=len_trim(str))
641 CASE (sirius_integer_array_type)
642 CALL section_vals_val_get(section, option_name, i_vals=ivals)
643 CALL sirius_option_set(sctx, section_name, option_name, ctype, c_loc(ivals(1)), &
644 max_length=num_possible_values)
645 CASE (sirius_number_array_type)
646 CALL section_vals_val_get(section, option_name, r_vals=rvals)
647 CALL sirius_option_set(sctx, section_name, option_name, ctype, c_loc(rvals(1)), &
648 max_length=num_possible_values)
649 CASE (sirius_logical_array_type)
650 CALL section_vals_val_get(section, option_name, l_vals=lvals)
651 CALL sirius_option_set(sctx, section_name, option_name, ctype, c_loc(lvals(1)), &
652 max_length=num_possible_values)
653 CASE (sirius_string_array_type)
654 CALL section_vals_val_get(section, option_name, explicit=explicit, n_rep_val=length)
655 DO j = 1, length
656 str = ''
657 CALL section_vals_val_get(section, option_name, i_rep_val=j, explicit=explicit, c_vals=tmp)
658 str = trim(adjustl(tmp(j)))
659 CALL sirius_option_set(sctx, section_name, option_name, ctype, c_loc(str), &
660 max_length=len_trim(str), append=.true.)
661 END DO
662 CASE DEFAULT
663 END SELECT
664 END IF
665 END IF
666 END DO
667 END SUBROUTINE cp_sirius_fill_in_section
668
669!***************************************************************************************************
670!> \brief ...
671!> \param pwdft_env ...
672!> \param calculate_forces ...
673!> \param calculate_stress_tensor ...
674!> \param
675!> \par History
676!> 07.2018 start the Sirius library
677!> \author JHU
678! **************************************************************************************************
679 SUBROUTINE cp_sirius_energy_force(pwdft_env, calculate_forces, calculate_stress_tensor)
680 TYPE(pwdft_environment_type), INTENT(INOUT), &
681 POINTER :: pwdft_env
682 LOGICAL, INTENT(IN) :: calculate_forces, calculate_stress_tensor
683
684 INTEGER :: iw, n1, n2
685 LOGICAL :: do_print, gs_converged
686 REAL(KIND=c_double) :: etotal
687 REAL(KIND=c_double), ALLOCATABLE, DIMENSION(:, :) :: cforces
688 REAL(KIND=c_double), DIMENSION(3, 3) :: cstress
689 REAL(KIND=dp), DIMENSION(3, 3) :: stress
690 REAL(KIND=dp), DIMENSION(:, :), POINTER :: forces
691 TYPE(cp_logger_type), POINTER :: logger
692 TYPE(pwdft_energy_type), POINTER :: energy
693 TYPE(section_vals_type), POINTER :: print_section, pwdft_input
694 TYPE(sirius_ground_state_handler) :: gs_handler
695
696 cpassert(ASSOCIATED(pwdft_env))
697
698 NULLIFY (logger)
699 logger => cp_get_default_logger()
701
702 CALL pwdft_env_get(pwdft_env=pwdft_env, gs_handler=gs_handler)
703 CALL sirius_find_ground_state(gs_handler, converged=gs_converged)
704
705 IF (gs_converged) THEN
706 IF (iw > 0) WRITE (iw, '(A)') "CP2K/SIRIUS: ground state is converged"
707 ELSE
708 IF (pwdft_env%ignore_convergence_failure) THEN
709 IF (iw > 0) WRITE (iw, '(A)') "CP2K/SIRIUS Warning: ground state is not converged"
710 ELSE
711 cpabort("CP2K/SIRIUS (ground state): SIRIUS did not converge.")
712 END IF
713 END IF
714 IF (iw > 0) CALL m_flush(iw)
715
716 CALL pwdft_env_get(pwdft_env=pwdft_env, energy=energy)
717 etotal = 0.0_c_double
718
719 CALL sirius_get_energy(gs_handler, 'band-gap', etotal)
720 energy%band_gap = etotal
721
722 etotal = 0.0_c_double
723 CALL sirius_get_energy(gs_handler, 'total', etotal)
724 energy%etotal = etotal
725
726 ! extract entropy (TS returned by sirius is always negative, sign
727 ! convention in QE)
728 etotal = 0.0_c_double
729 CALL sirius_get_energy(gs_handler, 'demet', etotal)
730 energy%entropy = -etotal
731
732 IF (calculate_forces) THEN
733 CALL pwdft_env_get(pwdft_env=pwdft_env, forces=forces)
734 n1 = SIZE(forces, 1)
735 n2 = SIZE(forces, 2)
736
737 ALLOCATE (cforces(n2, n1))
738 cforces = 0.0_c_double
739 CALL sirius_get_forces(gs_handler, 'total', cforces)
740 ! Sirius computes the forces but cp2k use the gradient everywhere
741 ! so a minus sign is needed.
742 ! note also that sirius and cp2k store the forces transpose to each other
743 ! sirius : forces(coordinates, atoms)
744 ! cp2k : forces(atoms, coordinates)
745 forces = -transpose(cforces(:, :))
746 DEALLOCATE (cforces)
747 END IF
748
749 IF (calculate_stress_tensor) THEN
750 cstress = 0.0_c_double
751 CALL sirius_get_stress_tensor(gs_handler, 'total', cstress)
752 stress(1:3, 1:3) = cstress(1:3, 1:3)
753 CALL pwdft_env_set(pwdft_env=pwdft_env, stress=stress)
754 END IF
755
756 CALL pwdft_env_get(pwdft_env=pwdft_env, pwdft_input=pwdft_input)
757 print_section => section_vals_get_subs_vals(pwdft_input, "PRINT")
758 CALL section_vals_get(print_section, explicit=do_print)
759 IF (do_print) THEN
760 CALL cp_sirius_print_results(pwdft_env, print_section)
761 END IF
762 END SUBROUTINE cp_sirius_energy_force
763
764!***************************************************************************************************
765!> \brief ...
766!> \param pwdft_env ...
767!> \param print_section ...
768!> \param
769!> \par History
770!> 12.2019 init
771!> \author JHU
772! **************************************************************************************************
773 SUBROUTINE cp_sirius_print_results(pwdft_env, print_section)
774 TYPE(pwdft_environment_type), INTENT(INOUT), &
775 POINTER :: pwdft_env
776 TYPE(section_vals_type), POINTER :: print_section
777
778 CHARACTER(LEN=default_string_length) :: my_act, my_pos
779 INTEGER :: i, ik, iounit, ispn, iterstep, iv, iw, &
780 nbands, nhist, nkpts, nspins
781 INTEGER(KIND=C_INT) :: cint
782 LOGICAL :: append, dos, ionode
783 REAL(KIND=c_double) :: creal
784 REAL(KIND=c_double), ALLOCATABLE, DIMENSION(:) :: slist
785 REAL(KIND=dp) :: de, e_fermi(2), emax, emin, eval
786 REAL(KIND=dp), ALLOCATABLE, DIMENSION(:) :: wkpt
787 REAL(KIND=dp), ALLOCATABLE, DIMENSION(:, :) :: ehist, hist, occval
788 REAL(KIND=dp), ALLOCATABLE, DIMENSION(:, :, :) :: energies, occupations
789 TYPE(cp_logger_type), POINTER :: logger
790 TYPE(sirius_context_handler) :: sctx
791 TYPE(sirius_ground_state_handler) :: gs_handler
792 TYPE(sirius_kpoint_set_handler) :: ks_handler
793
794 NULLIFY (logger)
795 logger => cp_get_default_logger()
796 ionode = logger%para_env%is_source()
797 iounit = cp_logger_get_default_io_unit(logger)
798
799 ! Density of States
800 dos = btest(cp_print_key_should_output(logger%iter_info, print_section, "DOS"), cp_p_file)
801 IF (dos) THEN
802 CALL pwdft_env_get(pwdft_env, ks_handler=ks_handler)
803 CALL pwdft_env_get(pwdft_env, gs_handler=gs_handler)
804 CALL pwdft_env_get(pwdft_env, sctx=sctx)
805
806 CALL section_vals_val_get(print_section, "DOS%DELTA_E", r_val=de)
807 CALL section_vals_val_get(print_section, "DOS%APPEND", l_val=append)
808
809 CALL sirius_get_num_kpoints(ks_handler, cint)
810 nkpts = cint
811 CALL sirius_get_parameters(sctx, num_bands=cint)
812 nbands = cint
813 CALL sirius_get_parameters(sctx, num_spins=cint)
814 nspins = cint
815 e_fermi(:) = 0.0_dp
816 ALLOCATE (energies(nbands, nspins, nkpts))
817 energies = 0.0_dp
818 ALLOCATE (occupations(nbands, nspins, nkpts))
819 occupations = 0.0_dp
820 ALLOCATE (wkpt(nkpts))
821 ALLOCATE (slist(nbands))
822 DO ik = 1, nkpts
823 CALL sirius_get_kpoint_properties(ks_handler, ik, creal)
824 wkpt(ik) = creal
825 END DO
826 DO ik = 1, nkpts
827 DO ispn = 1, nspins
828 CALL sirius_get_band_energies(ks_handler, ik, ispn, slist)
829 energies(1:nbands, ispn, ik) = slist(1:nbands)
830 CALL sirius_get_band_occupancies(ks_handler, ik, ispn, slist)
831 occupations(1:nbands, ispn, ik) = slist(1:nbands)
832 END DO
833 END DO
834 emin = minval(energies)
835 emax = maxval(energies)
836 nhist = nint((emax - emin)/de) + 1
837 ALLOCATE (hist(nhist, nspins), occval(nhist, nspins), ehist(nhist, nspins))
838 hist = 0.0_dp
839 occval = 0.0_dp
840 ehist = 0.0_dp
841
842 DO ik = 1, nkpts
843 DO ispn = 1, nspins
844 DO i = 1, nbands
845 eval = energies(i, ispn, ik) - emin
846 iv = nint(eval/de) + 1
847 cpassert((iv > 0) .AND. (iv <= nhist))
848 hist(iv, ispn) = hist(iv, ispn) + wkpt(ik)
849 occval(iv, ispn) = occval(iv, ispn) + wkpt(ik)*occupations(i, ispn, ik)
850 END DO
851 END DO
852 END DO
853 hist = hist/real(nbands, kind=dp)
854 DO i = 1, nhist
855 ehist(i, 1:nspins) = emin + (i - 1)*de
856 END DO
857
858 iterstep = logger%iter_info%iteration(logger%iter_info%n_rlevel)
859 my_act = "WRITE"
860 IF (append .AND. iterstep > 1) THEN
861 my_pos = "APPEND"
862 ELSE
863 my_pos = "REWIND"
864 END IF
865
866 iw = cp_print_key_unit_nr(logger, print_section, "DOS", &
867 extension=".dos", file_position=my_pos, file_action=my_act, &
868 file_form="FORMATTED")
869 IF (iw > 0) THEN
870 IF (nspins == 2) THEN
871 WRITE (unit=iw, fmt="(T2,A,I0,A,2F12.6)") &
872 "# DOS at iteration step i = ", iterstep, ", E_Fermi[a.u.] = ", e_fermi(1:2)
873 WRITE (unit=iw, fmt="(T2,A, A)") " Energy[a.u.] Alpha_Density Occupation", &
874 " Beta_Density Occupation"
875 ELSE
876 WRITE (unit=iw, fmt="(T2,A,I0,A,F12.6)") &
877 "# DOS at iteration step i = ", iterstep, ", E_Fermi[a.u.] = ", e_fermi(1)
878 WRITE (unit=iw, fmt="(T2,A)") " Energy[a.u.] Density Occupation"
879 END IF
880 DO i = 1, nhist
881 eval = emin + (i - 1)*de
882 IF (nspins == 2) THEN
883 WRITE (unit=iw, fmt="(F15.8,4F15.4)") eval, hist(i, 1), occval(i, 1), &
884 hist(i, 2), occval(i, 2)
885 ELSE
886 WRITE (unit=iw, fmt="(F15.8,2F15.4)") eval, hist(i, 1), occval(i, 1)
887 END IF
888 END DO
889 END IF
890 CALL cp_print_key_finished_output(iw, logger, print_section, "DOS")
891
892 DEALLOCATE (energies, occupations, wkpt, slist)
893 DEALLOCATE (hist, occval, ehist)
894 END IF
895 END SUBROUTINE cp_sirius_print_results
896
897END MODULE sirius_interface
898
899#else
900
901!***************************************************************************************************
902!> \brief Empty implementation in case SIRIUS is not compiled in.
903!***************************************************************************************************
906#include "./base/base_uses.f90"
907
908 IMPLICIT NONE
909 PRIVATE
910
913
914CONTAINS
915
916! **************************************************************************************************
917!> \brief Empty implementation in case SIRIUS is not compiled in.
918! **************************************************************************************************
919 SUBROUTINE cp_sirius_init()
920 END SUBROUTINE cp_sirius_init
921
922! **************************************************************************************************
923!> \brief Empty implementation in case SIRIUS is not compiled in.
924! **************************************************************************************************
926 END SUBROUTINE cp_sirius_finalize
927
928! **************************************************************************************************
929!> \brief Empty implementation in case SIRIUS is not compiled in.
930!> \param pwdft_env ...
931! **************************************************************************************************
932 SUBROUTINE cp_sirius_create_env(pwdft_env)
933 TYPE(pwdft_environment_type), POINTER :: pwdft_env
934
935 mark_used(pwdft_env)
936 cpabort("Sirius library is missing")
937 END SUBROUTINE cp_sirius_create_env
938
939! **************************************************************************************************
940!> \brief Empty implementation in case SIRIUS is not compiled in.
941!> \param pwdft_env ...
942!> \param calculate_forces ...
943!> \param calculate_stress ...
944! **************************************************************************************************
945 SUBROUTINE cp_sirius_energy_force(pwdft_env, calculate_forces, calculate_stress)
946 TYPE(pwdft_environment_type), POINTER :: pwdft_env
947 LOGICAL :: calculate_forces, calculate_stress
948
949 mark_used(pwdft_env)
950 mark_used(calculate_forces)
951 mark_used(calculate_stress)
952 cpabort("Sirius library is missing")
953 END SUBROUTINE cp_sirius_energy_force
954
955! **************************************************************************************************
956!> \brief Empty implementation in case SIRIUS is not compiled in.
957!> \param pwdft_env ...
958! **************************************************************************************************
959 SUBROUTINE cp_sirius_update_context(pwdft_env)
960 TYPE(pwdft_environment_type), POINTER :: pwdft_env
961
962 mark_used(pwdft_env)
963 cpabort("Sirius library is missing")
964 END SUBROUTINE cp_sirius_update_context
965
966END MODULE sirius_interface
967
968#endif
calculate the orbitals for a given atomic kind type
subroutine, public calculate_atomic_orbitals(atomic_kind, qs_kind, agrid, iunit, pmat, fmat, density, wavefunction, wfninfo, confine, xc_section, nocc)
...
subroutine, public gth_potential_conversion(gth_potential, gth_atompot)
...
Define the atom type and its sub types.
Definition atom_types.F:15
Routines that process Quantum Espresso UPF files.
Definition atom_upf.F:14
Some basic routines for atomic calculations.
Definition atom_utils.F:15
pure subroutine, public atom_local_potential(locpot, gthpot, rr)
...
Definition atom_utils.F:799
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind(atomic_kind, fist_potential, element_symbol, name, mass, kind_number, natom, atom_list, rcov, rvdw, z, qeff, apol, cpol, mm_radius, shell, shell_active, damping)
Get attributes of an atomic kind.
Handles all functions related to the CELL.
Definition cell_types.F:15
subroutine, public real_to_scaled(s, r, cell)
Transform real to scaled cell coordinates. s=h_inv*r.
Definition cell_types.F:486
various routines to log and control the output. The idea is that decisions about where to log should ...
integer function, public cp_logger_get_default_io_unit(logger)
returns the unit nr for the ionode (-1 on all other processors) skips as well checks if the procs cal...
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,...
integer, parameter, public cp_p_file
integer function, public cp_print_key_should_output(iteration_info, basis_section, print_key_path, used_print_key, first_time)
returns what should be done with the given property if btest(res,cp_p_store) then the property should...
Definition of the atomic potential types.
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public do_gapw_log
integer, parameter, public sirius_func_vdwdfcx
integer, parameter, public sirius_func_vdwdf2
integer, parameter, public sirius_func_vdwdf
objects that represent the structure of input sections and the data contained in an input section
type(section_vals_type) function, pointer, public section_vals_get_subs_vals2(section_vals, i_section, i_rep_section)
returns the values of the n-th non default subsection (null if no such section exists (not so many no...
recursive type(section_vals_type) function, pointer, public section_vals_get_subs_vals(section_vals, subsection_name, i_rep_section, can_return_null)
returns the values of the requested subsection
subroutine, public section_vals_get(section_vals, ref_count, n_repetition, n_subs_vals_rep, section, explicit)
returns various attributes about the section_vals
subroutine, public section_vals_val_get(section_vals, keyword_name, i_rep_section, i_rep_val, n_rep_val, val, l_val, i_val, r_val, c_val, l_vals, i_vals, r_vals, c_vals, explicit)
returns the requested value
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
integer, parameter, public default_string_length
Definition kinds.F:57
Machine interface based on Fortran 2003 and POSIX.
Definition machine.F:17
subroutine, public m_flush(lunit)
flushes units if the &GLOBAL flag is set accordingly
Definition machine.F:130
Definition of mathematical constants and functions.
real(kind=dp), dimension(0:maxfac), parameter, public gamma1
real(kind=dp), parameter, public fourpi
Interface to the message passing library MPI.
Define the data structure for the particle information.
Definition of physical constants:
Definition physcon.F:68
real(kind=dp), parameter, public massunit
Definition physcon.F:141
The type definitions for the PWDFT environment.
subroutine, public pwdft_env_get(pwdft_env, pwdft_input, force_env_input, xc_input, cp_subsys, qs_subsys, para_env, energy, forces, stress, sctx, gs_handler, ks_handler)
Returns various attributes of the pwdft environment.
subroutine, public pwdft_env_set(pwdft_env, pwdft_input, force_env_input, xc_input, qs_subsys, cp_subsys, para_env, energy, forces, stress, sctx, gs_handler, ks_handler)
Sets various attributes of the pwdft environment.
subroutine, public deallocate_grid_atom(grid_atom)
Deallocate a Gaussian-type orbital (GTO) basis set data set.
subroutine, public allocate_grid_atom(grid_atom)
Initialize components of the grid_atom_type structure.
subroutine, public create_grid_atom(grid_atom, nr, na, llmax, ll, quadrature)
...
Define the quickstep kind type and their sub types.
subroutine, public get_qs_kind(qs_kind, basis_set, basis_type, ncgf, nsgf, all_potential, tnadd_potential, gth_potential, sgp_potential, upf_potential, se_parameter, dftb_parameter, xtb_parameter, dftb3_param, zatom, zeff, elec_conf, mao, lmax_dftb, alpha_core_charge, ccore_charge, core_charge, core_charge_radius, paw_proj_set, paw_atom, hard_radius, hard0_radius, max_rad_local, covalent_radius, vdw_radius, gpw_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, ngrid_ang, ngrid_rad, lmax_rho0, dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, u_minus_j, u_of_dft_plus_u, j_of_dft_plus_u, alpha_of_dft_plus_u, beta_of_dft_plus_u, j0_of_dft_plus_u, occupation_of_dft_plus_u, dispersion, bs_occupation, magnetization, no_optimize, addel, laddel, naddel, orbitals, max_scf, eps_scf, smear, u_ramping, u_minus_j_target, eps_u_ramping, init_u_ramping_each_scf, reltmat, ghost, floating, name, element_symbol, pao_basis_size, pao_model_file, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.
types that represent a quickstep subsys
subroutine, public qs_subsys_get(subsys, atomic_kinds, atomic_kind_set, particles, particle_set, local_particles, molecules, molecule_set, molecule_kinds, molecule_kind_set, local_molecules, para_env, colvar_p, shell_particles, core_particles, gci, multipoles, natom, nparticle, ncore, nshell, nkind, atprop, virial, results, cell, cell_ref, use_ref_cell, energy, force, qs_kind_set, cp_subsys, nelectron_total, nelectron_spin)
...
Interface to the SIRIUS Library.
subroutine, public cp_sirius_update_context(pwdft_env)
Empty implementation in case SIRIUS is not compiled in.
subroutine, public cp_sirius_init()
Empty implementation in case SIRIUS is not compiled in.
subroutine, public cp_sirius_energy_force(pwdft_env, calculate_forces, calculate_stress)
Empty implementation in case SIRIUS is not compiled in.
subroutine, public cp_sirius_finalize()
Empty implementation in case SIRIUS is not compiled in.
subroutine, public cp_sirius_create_env(pwdft_env)
Empty implementation in case SIRIUS is not compiled in.
Provides all information about a pseudopotential.
Definition atom_types.F:98
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
Definition cell_types.F:55
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
Provides all information about a quickstep kind.