(git:9111030)
Loading...
Searching...
No Matches
xc_gauxc_interface.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8#ifdef __GAUXC
9#include "gauxc/gauxc_config.f"
10#endif
11
12#define GAUXC_RETURN_IF_ERROR(status) IF (status%status%code /= 0) RETURN
13
14MODULE xc_gauxc_interface
15
16 USE iso_fortran_env, ONLY: &
17 error_unit
18#if defined (__HAS_IEEE_EXCEPTIONS)
19 USE ieee_exceptions, ONLY: &
20 ieee_all, &
21 ieee_get_halting_mode, &
22 ieee_set_halting_mode
23#endif
24 USE iso_c_binding, ONLY: &
25 c_associated, &
26 c_bool, &
27 c_char, &
28 c_double, &
29 c_f_pointer, &
30 c_int, &
31 c_int32_t, &
32 c_int64_t, &
33 c_null_char, &
34 c_null_ptr, &
35 c_ptr, &
36 c_size_t
37 USE particle_types, ONLY: &
39 USE qs_kind_types, ONLY: &
42 USE cp_dbcsr_api, ONLY: &
44 USE cp_log_handling, ONLY: &
46
47#ifdef __GAUXC
48
49 USE kinds, ONLY: &
52 dp
53 USE physcon, ONLY: &
54 bohr
55 USE atomic_kind_types, ONLY: &
59 USE qs_integral_utils, ONLY: &
61 USE basis_set_types, ONLY: &
65 USE periodic_table, ONLY: &
67 USE gauxc_status, ONLY: &
68 gauxc_status_message, &
69 gauxc_status_type
70 USE gauxc_enums, ONLY: &
71 gauxc_atomicgridsizedefault, &
72 gauxc_executionspace, &
73 gauxc_pruningscheme, &
74 gauxc_radialquad
75 USE gauxc_runtime_environment, ONLY: &
76 gauxc_runtime_environment_delete, &
77 gauxc_runtime_environment_new, &
78 gauxc_runtime_environment_type
79#ifdef GAUXC_HAS_DEVICE
80 USE gauxc_runtime_environment, ONLY: &
81 gauxc_device_runtime_environment_new
82#endif
83 USE gauxc_molecule, ONLY: &
84 gauxc_delete, &
85 gauxc_molecule_new_from_atoms, &
86 gauxc_molecule_type
87 USE gauxc_atom, ONLY: &
88 gauxc_atom_type
89 USE gauxc_basisset, ONLY: &
90 gauxc_basisset_new, &
91 gauxc_basisset_new_from_shells, &
92 gauxc_basisset_type, &
93 gauxc_delete
94 USE gauxc_shell, ONLY: &
95 gauxc_shell_type
96 USE gauxc_molgrid, ONLY: &
97 gauxc_delete, &
98 gauxc_molgrid_new_default, &
99 gauxc_molgrid_type
100 USE gauxc_load_balancer, ONLY: &
101 gauxc_delete, &
102 gauxc_load_balancer_factory_get_instance, &
103 gauxc_load_balancer_factory_new, &
104 gauxc_load_balancer_factory_type, &
105 gauxc_load_balancer_type
106 USE gauxc_molecular_weights, ONLY: &
107 gauxc_delete, &
108 gauxc_get_instance, &
109 gauxc_molecular_weights_factory_new, &
110 gauxc_molecular_weights_factory_type, &
111 gauxc_molecular_weights_modify_weights, &
112 gauxc_molecular_weights_settings, &
113 gauxc_molecular_weights_type
114 USE gauxc_xc_functional, ONLY: &
115 gauxc_delete, &
116 gauxc_functional_from_string, &
117 gauxc_functional_type
118 USE gauxc_integrator, ONLY: &
119 gauxc_delete, &
120 gauxc_integrator_eval_exc_grad_rks, &
121 gauxc_integrator_eval_exc_grad_uks, &
122 gauxc_integrator_eval_exc_vxc_rks, &
123 gauxc_integrator_eval_exc_vxc_uks, &
124 gauxc_integrator_new, &
125 gauxc_integrator_type
126#ifdef GAUXC_HAS_ONEDFT
127 USE gauxc_integrator, ONLY: &
128 gauxc_integrator_eval_exc_grad_onedft_uks, &
129 gauxc_integrator_eval_exc_vxc_onedft_uks
130 USE omp_lib, ONLY: &
131 omp_get_max_threads, &
132 omp_set_num_threads
133#endif
134#ifdef GAUXC_HAS_HDF5
135 USE gauxc_external_hdf5_write, ONLY: &
136 gauxc_write_hdf5_record
137#endif
138 USE string_utilities, ONLY: &
140#endif
141
142#include "../base/base_uses.f90"
143
144 IMPLICIT NONE
145 PRIVATE
146
147#ifndef __GAUXC
148
149 ! The module still exists as an empty shell when compiling without GauXC.
150
151 TYPE cp_gauxc_molecule_type
152 END TYPE cp_gauxc_molecule_type
153
154 TYPE cp_gauxc_basisset_type
155 INTEGER :: max_l = -1
156 END TYPE cp_gauxc_basisset_type
157
158 TYPE cp_gauxc_grid_type
159 END TYPE cp_gauxc_grid_type
160
161 TYPE cp_gauxc_integrator_type
162 END TYPE cp_gauxc_integrator_type
163
164 TYPE cp_gauxc_status_type
165 END TYPE cp_gauxc_status_type
166
167#else
168
169 ! TODO can we make the single fields private somehow?
170
171 TYPE cp_gauxc_molecule_type
172 TYPE(gauxc_molecule_type) :: molecule
173 END TYPE cp_gauxc_molecule_type
174
175 TYPE cp_gauxc_basisset_type
176 TYPE(gauxc_basisset_type) :: basis
177 INTEGER :: max_l = -1
178 END TYPE cp_gauxc_basisset_type
179
180 TYPE cp_gauxc_grid_type
181 TYPE(gauxc_molgrid_type) :: grid
182 TYPE(gauxc_load_balancer_type) :: lb
183 TYPE(gauxc_load_balancer_factory_type) :: lbf
184 TYPE(gauxc_molecular_weights_type) :: mw
185 TYPE(gauxc_molecular_weights_factory_type) :: mwf
186 TYPE(gauxc_runtime_environment_type) :: rt
187 LOGICAL :: owns_rt = .false.
188 END TYPE cp_gauxc_grid_type
189
190 TYPE cp_gauxc_integrator_type
191 TYPE(gauxc_functional_type) :: func
192 TYPE(gauxc_integrator_type) :: integrator
193 END TYPE cp_gauxc_integrator_type
194
195 TYPE cp_gauxc_status_type
196 TYPE(gauxc_status_type) :: status
197 END TYPE cp_gauxc_status_type
198
199 TYPE(gauxc_runtime_environment_type) :: rt
200 INTEGER :: rt_mpi_comm = -1
201 LOGICAL :: rt_has_mpi_comm = .false.
202
203#endif
204
205 TYPE cp_gauxc_xc_type
206 REAL(c_double) :: exc = 0.0_c_double
207 REAL(c_double), DIMENSION(:, :), ALLOCATABLE :: vxc_scalar, vxc_zeta
208 END TYPE cp_gauxc_xc_type
209
210 TYPE cp_gauxc_xc_gradient_type
211 REAL(c_double), ALLOCATABLE, DIMENSION(:) :: exc_grad
212 END TYPE cp_gauxc_xc_gradient_type
213
214 CHARACTER(len=*), PARAMETER :: no_gauxc_message = "Compile CP2K with GauXC to use this functionality!"
215
216 PUBLIC :: &
217 cp_gauxc_basisset_type, &
218 cp_gauxc_grid_type, &
219 cp_gauxc_integrator_type, &
220 cp_gauxc_molecule_type, &
221 cp_gauxc_status_type, &
222 cp_gauxc_xc_gradient_type, &
223 cp_gauxc_xc_type, &
224 gauxc_check_status, &
225 gauxc_compute_xc_gradient, &
226 gauxc_compute_xc, &
227 gauxc_create_basisset, &
228 gauxc_create_grid, &
229 gauxc_create_integrator, &
230 gauxc_create_molecule, &
231 gauxc_destroy_basisset, &
232 gauxc_destroy_grid, &
233 gauxc_destroy_integrator, &
234 gauxc_destroy_molecule, &
235 gauxc_finalize, &
236 gauxc_init, &
237 gauxc_write_basisset_hdf5, &
238 gauxc_write_molecule_hdf5
239CONTAINS
240
241! **************************************************************************************************
242!> \brief ...
243!> \param status ...
244! **************************************************************************************************
245 SUBROUTINE print_gauxc_status_message(status)
246 ! IMPORT :: c_ptr
247 TYPE(cp_gauxc_status_type) :: status
248
249#ifdef __GAUXC
250 CHARACTER(kind=c_char), POINTER :: s(:)
251 CHARACTER(len=32) :: stderr_env
252 INTEGER :: i, ierr, iw
253 LOGICAL :: print_to_stderr
254 INTEGER, PARAMETER :: status_message_length = 4096
255
257 ierr = error_unit
258 CALL get_environment_variable("CP2K_GAUXC_STATUS_STDERR", stderr_env)
259 CALL uppercase(stderr_env)
260 SELECT CASE (trim(stderr_env))
261 CASE ("", "0", "FALSE", "F", "OFF", "NO")
262 print_to_stderr = .false.
263 CASE ("1", "TRUE", "T", "ON", "YES")
264 print_to_stderr = .true.
265 CASE DEFAULT
266 print_to_stderr = .true.
267 END SELECT
268 IF (iw > 0) THEN
269 WRITE (unit=iw, fmt='(a,1x,i0)') "GauXC returned with status code", status%status%code
270 IF (c_associated(status%status%message)) THEN
271 WRITE (unit=iw, fmt='(a)', advance='no') "GauXC status message: ["
272
273 CALL c_f_pointer(status%status%message, s, [status_message_length])
274 DO i = 1, SIZE(s)
275 IF (s(i) == c_null_char) EXIT
276 WRITE (unit=iw, fmt='(A)', advance='no') s(i)
277 END DO
278
279 WRITE (unit=iw, fmt='(a)') "]"
280 ELSE
281 WRITE (unit=iw, fmt='(a)') "GauXC status message: [null]"
282 END IF
283 END IF
284 IF (print_to_stderr) THEN
285 WRITE (unit=ierr, fmt='(a,1x,i0)') "GauXC returned with status code", status%status%code
286 IF (c_associated(status%status%message)) THEN
287 WRITE (unit=ierr, fmt='(a)', advance='no') "GauXC status message: ["
288
289 CALL c_f_pointer(status%status%message, s, [status_message_length])
290 DO i = 1, SIZE(s)
291 IF (s(i) == c_null_char) EXIT
292 WRITE (unit=ierr, fmt='(A)', advance='no') s(i)
293 END DO
294
295 WRITE (unit=ierr, fmt='(a)') "]"
296 ELSE
297 WRITE (unit=ierr, fmt='(a)') "GauXC status message: [null]"
298 END IF
299 END IF
300#else
301 mark_used(status)
302#endif
303 END SUBROUTINE print_gauxc_status_message
304
305! **************************************************************************************************
306!> \brief ...
307!> \param mpi_comm ...
308!> \param status ...
309! **************************************************************************************************
310 SUBROUTINE gauxc_init(mpi_comm, status)
311 INTEGER, INTENT(IN), OPTIONAL :: mpi_comm
312 TYPE(cp_gauxc_status_type), INTENT(OUT) :: status
313
314#ifdef __GAUXC
315#if defined(GAUXC_HAS_MPI) && defined(__parallel)
316 IF (PRESENT(mpi_comm)) THEN
317 rt = gauxc_runtime_environment_new(status%status, mpi_comm)
318 rt_mpi_comm = mpi_comm
319 rt_has_mpi_comm = .true.
320 ELSE
321 rt = gauxc_runtime_environment_new(status%status)
322 rt_mpi_comm = -1
323 rt_has_mpi_comm = .false.
324 END IF
325#else
326 mark_used(mpi_comm)
327 rt = gauxc_runtime_environment_new(status%status)
328 rt_mpi_comm = -1
329 rt_has_mpi_comm = .false.
330#endif
331 gauxc_return_if_error(status)
332#else
333 mark_used(mpi_comm)
334 mark_used(status)
335#endif
336 END SUBROUTINE gauxc_init
337
338! **************************************************************************************************
339!> \brief ...
340!> \param status ...
341! **************************************************************************************************
342 SUBROUTINE gauxc_finalize(status)
343 TYPE(cp_gauxc_status_type), INTENT(OUT) :: status
344
345#ifdef __GAUXC
346 CALL gauxc_runtime_environment_delete(status%status, rt)
347 gauxc_return_if_error(status)
348 rt_mpi_comm = -1
349 rt_has_mpi_comm = .false.
350#else
351 mark_used(status)
352#endif
353 END SUBROUTINE gauxc_finalize
354
355! **************************************************************************************************
356!> \brief ...
357!> \param particle_set ...
358!> \param status ...
359!> \return ...
360! **************************************************************************************************
361 FUNCTION gauxc_create_molecule(particle_set, status) RESULT(res)
362 TYPE(particle_type), DIMENSION(:), INTENT(IN) :: particle_set
363 TYPE(cp_gauxc_status_type), INTENT(OUT) :: status
364 TYPE(cp_gauxc_molecule_type) :: res
365
366#ifdef __GAUXC
367 CHARACTER(LEN=2) :: element_symbol
368 INTEGER :: atomic_number, i, natoms
369 TYPE(atomic_kind_type), POINTER :: atomic_kind
370 TYPE(gauxc_atom_type), ALLOCATABLE, DIMENSION(:) :: atoms
371
372 natoms = SIZE(particle_set)
373 ALLOCATE (atoms(natoms))
374
375 DO i = 1, natoms
376 atomic_kind => particle_set(i)%atomic_kind
377 CALL get_atomic_kind(atomic_kind, element_symbol=element_symbol)
378 CALL get_ptable_info(element_symbol, number=atomic_number)
379 atoms(i)%atomic_number = int(atomic_number, c_int64_t)
380 atoms(i)%x = real(particle_set(i)%r(1), c_double)
381 atoms(i)%y = real(particle_set(i)%r(2), c_double)
382 atoms(i)%z = real(particle_set(i)%r(3), c_double)
383 END DO
384
385 res%molecule = gauxc_molecule_new_from_atoms(status%status, atoms, int(natoms, c_size_t))
386 gauxc_return_if_error(status)
387
388 DEALLOCATE (atoms)
389#else
390 mark_used(particle_set)
391 mark_used(res)
392 mark_used(status)
393 cpabort(no_gauxc_message)
394#endif
395 END FUNCTION gauxc_create_molecule
396
397! **************************************************************************************************
398!> \brief ...
399!> \param qs_kind_set ...
400!> \param particle_set ...
401!> \param status ...
402!> \return ...
403! **************************************************************************************************
404 FUNCTION gauxc_create_basisset(qs_kind_set, particle_set, status) RESULT(res)
405 TYPE(qs_kind_type), DIMENSION(:), INTENT(IN), &
406 POINTER :: qs_kind_set
407 TYPE(particle_type), DIMENSION(:), INTENT(IN) :: particle_set
408 TYPE(cp_gauxc_status_type), INTENT(OUT) :: status
409 TYPE(cp_gauxc_basisset_type) :: res
410
411#ifdef __GAUXC
412 INTEGER :: iatom, ikind, iprim, iset, ishell, lval, &
413 nkind, npgf, nset, nshell, &
414 nshell_total, shell_index, natoms
415 REAL(c_double), DIMENSION(3) :: shell_origin
416 TYPE(atomic_kind_type), POINTER :: atomic_kind
417 TYPE(gauxc_shell_type), ALLOCATABLE, DIMENSION(:) :: shells
418 TYPE(gto_basis_set_p_type), DIMENSION(:), POINTER :: basis_set_list
419 TYPE(gto_basis_set_type), POINTER :: gto_basis
420
421 nkind = SIZE(qs_kind_set)
422 natoms = SIZE(particle_set)
423
424 ALLOCATE (basis_set_list(nkind))
425 CALL basis_set_list_setup(basis_set_list, "ORB", qs_kind_set)
426
427 nshell_total = 0
428 DO iatom = 1, natoms
429 atomic_kind => particle_set(iatom)%atomic_kind
430 CALL get_atomic_kind(atomic_kind, kind_number=ikind)
431 gto_basis => basis_set_list(ikind)%gto_basis_set
432 cpassert(ASSOCIATED(gto_basis))
433 ! CALL write_gto_basis_set(gto_basis, 6, "–––––GAUXC-CREATE-BASISSET–––––")
434 nshell_total = nshell_total + sum(gto_basis%nshell)
435 END DO
436
437 ALLOCATE (shells(nshell_total))
438
439 shell_index = 0
440 res%max_l = -1
441 DO iatom = 1, natoms ! for each atom
442 atomic_kind => particle_set(iatom)%atomic_kind
443 CALL get_atomic_kind(atomic_kind, kind_number=ikind)
444 gto_basis => basis_set_list(ikind)%gto_basis_set
445 cpassert(ASSOCIATED(gto_basis))
446
447 shell_origin(1) = real(particle_set(iatom)%r(1), c_double)
448 shell_origin(2) = real(particle_set(iatom)%r(2), c_double)
449 shell_origin(3) = real(particle_set(iatom)%r(3), c_double)
450
451 nset = gto_basis%nset
452 cpassert(nset == SIZE(gto_basis%nshell))
453 DO iset = 1, nset ! for each shell group
454 nshell = gto_basis%nshell(iset)
455 npgf = gto_basis%npgf(iset) ! corresponds with nprim of gauxc
456
457 DO ishell = 1, gto_basis%nshell(iset) ! for each shell within the shell group
458 shell_index = shell_index + 1 ! global shell index, flattened over atoms and groups
459 lval = gto_basis%l(ishell, iset)
460 res%max_l = max(res%max_l, lval)
461 shells(shell_index)%l = int(lval, c_int32_t)
462 ! FIXME hardcoded true param
463 ! pure=1: spherical Gaussians; pure=0: cartesian Gaussians
464 shells(shell_index)%pure = .true._c_bool
465 shells(shell_index)%nprim = int(npgf, c_int32_t)
466 shells(shell_index)%origin = shell_origin
467
468 DO iprim = 1, npgf
469 shells(shell_index)%exponents(iprim) = &
470 REAL(gto_basis%zet(iprim, iset), c_double)
471 shells(shell_index)%coefficients(iprim) = &
472 REAL(gto_basis%norm_cgf(gto_basis%first_cgf(ishell, iset))* &
473 gto_basis%gcc(iprim, ishell, iset), c_double)
474 END DO
475 END DO
476 END DO
477 END DO
478
479 res%basis = gauxc_basisset_new_from_shells( &
480 status%status, &
481 shells, &
482 normalize=.false.)
483 gauxc_return_if_error(status)
484
485 DEALLOCATE (shells)
486 DEALLOCATE (basis_set_list)
487
488#else
489 mark_used(particle_set)
490 mark_used(qs_kind_set)
491 mark_used(res)
492 mark_used(status)
493 cpabort(no_gauxc_message)
494#endif
495 END FUNCTION gauxc_create_basisset
496
497! **************************************************************************************************
498!> \brief ...
499!> \param molecule ...
500!> \param basis ...
501!> \param grid_type ...
502!> \param radial_quadrature ...
503!> \param pruning_scheme ...
504!> \param lb_exec_space ...
505!> \param batch_size ...
506!> \param device_runtime_fill_fraction ...
507!> \param status ...
508!> \param mpi_comm optional communicator for a grid-local GauXC runtime
509!> \param force_new_runtime force creation of a grid-local GauXC runtime
510!> \return ...
511! **************************************************************************************************
512 FUNCTION gauxc_create_grid( &
513 molecule, &
514 basis, &
515 grid_type, &
516 radial_quadrature, &
517 pruning_scheme, &
518 lb_exec_space, &
519 batch_size, &
520 device_runtime_fill_fraction, &
521 status, &
522 mpi_comm, &
523 force_new_runtime) RESULT(res)
524
525 TYPE(cp_gauxc_molecule_type), INTENT(IN) :: molecule
526 TYPE(cp_gauxc_basisset_type), INTENT(in) :: basis
527 CHARACTER(len=*) :: grid_type, lb_exec_space, &
528 pruning_scheme, radial_quadrature
529 INTEGER :: batch_size
530 REAL(c_double), INTENT(IN) :: device_runtime_fill_fraction
531 TYPE(cp_gauxc_status_type), INTENT(OUT) :: status
532 INTEGER, INTENT(IN), OPTIONAL :: mpi_comm
533 LOGICAL, INTENT(IN), OPTIONAL :: force_new_runtime
534 TYPE(cp_gauxc_grid_type) :: res
535
536#ifdef __GAUXC
537 INTEGER(c_int) :: grid_type_local, int_exec_space_local, &
538 lb_exec_space_local, &
539 pruning_scheme_local, radial_quad_local
540 LOGICAL :: force_new_runtime_local, use_device_runtime
541
542 grid_type_local = read_atomic_grid_size(grid_type)
543 radial_quad_local = read_radial_quad(radial_quadrature)
544 pruning_scheme_local = read_pruning_scheme(pruning_scheme)
545 lb_exec_space_local = read_execution_space(lb_exec_space)
546 int_exec_space_local = read_execution_space("host")
547 use_device_runtime = (lb_exec_space_local == gauxc_executionspace%device)
548 force_new_runtime_local = .false.
549 IF (PRESENT(force_new_runtime)) force_new_runtime_local = force_new_runtime
550 res%owns_rt = .false.
551
552 IF (use_device_runtime) THEN
553#ifdef GAUXC_HAS_DEVICE
554#if defined(GAUXC_HAS_MPI) && defined(__parallel)
555 IF (PRESENT(mpi_comm)) THEN
556 res%rt = gauxc_device_runtime_environment_new( &
557 status%status, mpi_comm, device_runtime_fill_fraction)
558 ELSE
559 res%rt = gauxc_device_runtime_environment_new( &
560 status%status, device_runtime_fill_fraction)
561 END IF
562#else
563 mark_used(mpi_comm)
564 res%rt = gauxc_device_runtime_environment_new( &
565 status%status, device_runtime_fill_fraction)
566#endif
567 gauxc_return_if_error(status)
568 res%owns_rt = .true.
569#else
570 mark_used(device_runtime_fill_fraction)
571 cpabort("GauXC was built without device runtime support")
572#endif
573 ELSE
574#if defined(GAUXC_HAS_MPI) && defined(__parallel)
575 IF (PRESENT(mpi_comm)) THEN
576 ! Reuse the global runtime when the requested communicator matches
577 ! the communicator used during gauxc_init.
578 IF (force_new_runtime_local .OR. .NOT. rt_has_mpi_comm .OR. &
579 mpi_comm /= rt_mpi_comm) THEN
580 res%rt = gauxc_runtime_environment_new(status%status, mpi_comm)
581 gauxc_return_if_error(status)
582 res%owns_rt = .true.
583 END IF
584 END IF
585#else
586 mark_used(mpi_comm)
587 mark_used(force_new_runtime)
588#endif
589 END IF
590
591 res%grid = gauxc_molgrid_new_default( &
592 status%status, &
593 molecule%molecule, &
594 pruning_scheme_local, &
595 int(batch_size, c_int64_t), &
596 radial_quad_local, &
597 grid_type_local)
598 gauxc_return_if_error(status)
599
600 res%lbf = gauxc_load_balancer_factory_new( &
601 status%status, &
602 lb_exec_space_local)
603 gauxc_return_if_error(status)
604
605 IF (res%owns_rt) THEN
606 res%lb = gauxc_load_balancer_factory_get_instance( &
607 status%status, &
608 res%lbf, &
609 res%rt, &
610 molecule%molecule, &
611 res%grid, &
612 basis%basis)
613 ELSE
614 res%lb = gauxc_load_balancer_factory_get_instance( &
615 status%status, &
616 res%lbf, &
617 rt, &
618 molecule%molecule, &
619 res%grid, &
620 basis%basis)
621 END IF
622 gauxc_return_if_error(status)
623
624 res%mwf = gauxc_molecular_weights_factory_new( &
625 status%status, &
626 int_exec_space_local)
627 gauxc_return_if_error(status)
628
629 res%mw = gauxc_get_instance( &
630 status%status, &
631 res%mwf)
632 gauxc_return_if_error(status)
633
634 CALL gauxc_molecular_weights_modify_weights( &
635 status%status, &
636 res%mw, &
637 res%lb)
638 gauxc_return_if_error(status)
639
640#else
641 mark_used(basis)
642 mark_used(batch_size)
643 mark_used(device_runtime_fill_fraction)
644 mark_used(grid_type)
645 mark_used(lb_exec_space)
646 mark_used(mpi_comm)
647 mark_used(force_new_runtime)
648 mark_used(molecule)
649 mark_used(pruning_scheme)
650 mark_used(radial_quadrature)
651 mark_used(res)
652 mark_used(status)
653 cpabort(no_gauxc_message)
654#endif
655 END FUNCTION gauxc_create_grid
656
657! **************************************************************************************************
658!> \brief ...
659!> \param xc_functional_name ...
660!> \param grid ...
661!> \param int_exec_space ...
662!> \param lwd_kernel ...
663!> \param nspins ...
664!> \param status ...
665!> \return ...
666! **************************************************************************************************
667 FUNCTION gauxc_create_integrator( &
668 xc_functional_name, &
669 grid, &
670 int_exec_space, &
671 lwd_kernel, &
672 nspins, &
673 status) RESULT(res)
674
675 CHARACTER(len=*), INTENT(IN) :: xc_functional_name, int_exec_space, &
676 lwd_kernel
677 TYPE(cp_gauxc_grid_type), INTENT(IN) :: grid
678 INTEGER, INTENT(IN) :: nspins
679 TYPE(cp_gauxc_status_type), INTENT(OUT) :: status
680 TYPE(cp_gauxc_integrator_type) :: res
681
682#ifdef __GAUXC
683 INTEGER(c_int) :: int_exec_space_local
684 LOGICAL(c_bool) :: polarized
685
686 polarized = (nspins == 2)
687 res%func = gauxc_functional_from_string( &
688 status%status, &
689 xc_functional_name, &
690 polarized)
691 gauxc_return_if_error(status)
692
693 int_exec_space_local = read_execution_space(int_exec_space)
694 res%integrator = gauxc_integrator_new( &
695 status%status, &
696 res%func, &
697 grid%lb, &
698 int_exec_space_local, &
699 local_work_kernel_name=trim(lwd_kernel))
700 gauxc_return_if_error(status)
701
702#else
703 mark_used(grid)
704 mark_used(int_exec_space)
705 mark_used(lwd_kernel)
706 mark_used(nspins)
707 mark_used(res)
708 mark_used(status)
709 mark_used(xc_functional_name)
710 cpabort(no_gauxc_message)
711#endif
712 END FUNCTION gauxc_create_integrator
713
714! **************************************************************************************************
715!> \brief ...
716!> \param integrator ...
717!> \param density_scalar ...
718!> \param density_zeta ...
719!> \param nspins ...
720!> \param status ...
721!> \param model ...
722!> \return ...
723! **************************************************************************************************
724 FUNCTION gauxc_compute_xc( &
725 integrator, &
726 density_scalar, &
727 density_zeta, &
728 nspins, &
729 status, &
730 model) RESULT(res)
731
732 TYPE(cp_gauxc_integrator_type), INTENT(IN) :: integrator
733 ! Must be inout since we need to modify the matrix for some code paths
734 REAL(c_double), DIMENSION(:, :) :: density_scalar
735 REAL(c_double), DIMENSION(:, :), INTENT(IN), &
736 OPTIONAL :: density_zeta
737 INTEGER, INTENT(IN) :: nspins
738 TYPE(cp_gauxc_status_type), INTENT(OUT) :: status
739 CHARACTER(len=*), INTENT(IN), OPTIONAL :: model
740 TYPE(cp_gauxc_xc_type) :: res
741
742#ifdef __GAUXC
743 CHARACTER(len=default_path_length) :: model_key
744 LOGICAL :: use_gauxc_model
745#ifdef GAUXC_HAS_ONEDFT
746 REAL(c_double), ALLOCATABLE, DIMENSION(:, :) :: density_zeta_zero
747#if defined (__HAS_IEEE_EXCEPTIONS)
748 LOGICAL, DIMENSION(5) :: ieee_halt
749#endif
750 INTEGER :: omp_max_threads_restore
751#endif
752
753 use_gauxc_model = .false.
754 IF (PRESENT(model)) THEN
755 model_key = adjustl(model)
756 CALL uppercase(model_key)
757 use_gauxc_model = (trim(model_key) /= "" .AND. trim(model_key) /= "NONE")
758 END IF
759
760 IF (.NOT. ALLOCATED(res%vxc_scalar)) THEN
761 ALLOCATE (res%vxc_scalar, mold=density_scalar)
762 ELSE
763 cpassert(all(shape(res%vxc_scalar) == shape(density_scalar)))
764 END IF
765 res%vxc_scalar = 0._dp
766
767 IF (use_gauxc_model) THEN
768#ifndef GAUXC_HAS_ONEDFT
769 cpabort("GauXC lacks Skala support")
770#else
771 ! Skala may change the OpenMP team size for later parallel regions.
772 ! Restore max threads only; omp_get_num_threads() is 1 here.
773 omp_max_threads_restore = omp_get_max_threads()
774#if defined (__HAS_IEEE_EXCEPTIONS)
775 CALL ieee_get_halting_mode(ieee_all, ieee_halt)
776 CALL ieee_set_halting_mode(ieee_all, .false.)
777#endif
778 IF (.NOT. ALLOCATED(res%vxc_zeta)) THEN
779 ALLOCATE (res%vxc_zeta, mold=density_scalar)
780 ELSE
781 cpassert(all(shape(res%vxc_zeta) == shape(density_scalar)))
782 END IF
783 res%vxc_zeta = 0._dp
784
785 IF (nspins == 1) THEN
786 ALLOCATE (density_zeta_zero, mold=density_scalar)
787 density_zeta_zero = 0._dp
788 CALL gauxc_integrator_eval_exc_vxc_onedft_uks( &
789 status%status, &
790 integrator%integrator, &
791 density_scalar, &
792 density_zeta_zero, &
793 trim(model), &
794 res%exc, &
795 res%vxc_scalar, &
796 res%vxc_zeta)
797 DEALLOCATE (density_zeta_zero)
798 ELSE
799 cpassert(PRESENT(density_zeta))
800 CALL gauxc_integrator_eval_exc_vxc_onedft_uks( &
801 status%status, &
802 integrator%integrator, &
803 density_scalar, &
804 density_zeta, &
805 trim(model), &
806 res%exc, &
807 res%vxc_scalar, &
808 res%vxc_zeta)
809 END IF
810#if defined (__HAS_IEEE_EXCEPTIONS)
811 CALL ieee_set_halting_mode(ieee_all, ieee_halt)
812#endif
813 CALL omp_set_num_threads(omp_max_threads_restore)
814 gauxc_return_if_error(status)
815 RETURN
816#endif
817 END IF
818
819 IF (nspins == 1) THEN
820 CALL gauxc_integrator_eval_exc_vxc_rks( &
821 status%status, &
822 integrator%integrator, &
823 density_scalar, &
824 res%exc, &
825 res%vxc_scalar)
826 ELSE
827 cpassert(PRESENT(density_zeta))
828
829 IF (.NOT. ALLOCATED(res%vxc_zeta)) THEN
830 ALLOCATE (res%vxc_zeta, mold=density_zeta)
831 ELSE
832 cpassert(all(shape(res%vxc_zeta) == shape(density_scalar)))
833 END IF
834 res%vxc_zeta = 0._dp
835
836 CALL gauxc_integrator_eval_exc_vxc_uks( &
837 status%status, &
838 integrator%integrator, &
839 density_scalar, &
840 density_zeta, &
841 res%exc, &
842 res%vxc_scalar, &
843 res%vxc_zeta)
844 END IF
845 gauxc_return_if_error(status)
846
847#else
848 mark_used(integrator)
849 mark_used(density_scalar)
850 mark_used(density_zeta)
851 mark_used(nspins)
852 mark_used(status)
853 mark_used(model)
854 cpabort(no_gauxc_message)
855#endif
856 END FUNCTION gauxc_compute_xc
857
858! **************************************************************************************************
859!> \brief ...
860!> \param integrator ...
861!> \param density_scalar ...
862!> \param density_zeta ...
863!> \param nspins ...
864!> \param natom ...
865!> \param status ...
866!> \param model ...
867!> \return ...
868! **************************************************************************************************
869 FUNCTION gauxc_compute_xc_gradient( &
870 integrator, &
871 density_scalar, &
872 density_zeta, &
873 nspins, &
874 natom, &
875 status, &
876 model) RESULT(res)
877
878 TYPE(cp_gauxc_integrator_type), INTENT(IN) :: integrator
879 REAL(c_double), DIMENSION(:, :), INTENT(IN) :: density_scalar
880 REAL(c_double), DIMENSION(:, :), INTENT(IN), &
881 OPTIONAL :: density_zeta
882 INTEGER, INTENT(IN) :: nspins, natom
883 TYPE(cp_gauxc_status_type), INTENT(OUT) :: status
884 CHARACTER(len=*), INTENT(IN), OPTIONAL :: model
885 TYPE(cp_gauxc_xc_gradient_type) :: res
886
887#ifdef __GAUXC
888 CHARACTER(len=default_path_length) :: model_key
889 LOGICAL :: use_gauxc_model
890#ifdef GAUXC_HAS_ONEDFT
891 REAL(c_double), ALLOCATABLE, DIMENSION(:, :) :: density_zeta_zero
892#if defined (__HAS_IEEE_EXCEPTIONS)
893 LOGICAL, DIMENSION(5) :: ieee_halt
894#endif
895 INTEGER :: omp_max_threads_restore
896#endif
897
898 ALLOCATE (res%exc_grad(3*natom))
899 res%exc_grad = 0._dp
900
901 use_gauxc_model = .false.
902 IF (PRESENT(model)) THEN
903 model_key = adjustl(model)
904 CALL uppercase(model_key)
905 use_gauxc_model = (trim(model_key) /= "" .AND. trim(model_key) /= "NONE")
906 END IF
907
908 IF (use_gauxc_model) THEN
909#ifndef GAUXC_HAS_ONEDFT
910 cpabort("GauXC lacks Skala support")
911#else
912 ! Skala may change the OpenMP team size for later parallel regions.
913 ! Restore max threads only; omp_get_num_threads() is 1 here.
914 omp_max_threads_restore = omp_get_max_threads()
915#if defined (__HAS_IEEE_EXCEPTIONS)
916 CALL ieee_get_halting_mode(ieee_all, ieee_halt)
917 CALL ieee_set_halting_mode(ieee_all, .false.)
918#endif
919 IF (nspins == 1) THEN
920 ALLOCATE (density_zeta_zero, mold=density_scalar)
921 density_zeta_zero = 0._dp
922 CALL gauxc_integrator_eval_exc_grad_onedft_uks( &
923 status%status, &
924 integrator%integrator, &
925 density_scalar, &
926 density_zeta_zero, &
927 trim(model), &
928 res%exc_grad)
929 DEALLOCATE (density_zeta_zero)
930 ELSE
931 cpassert(PRESENT(density_zeta))
932 CALL gauxc_integrator_eval_exc_grad_onedft_uks( &
933 status%status, &
934 integrator%integrator, &
935 density_scalar, &
936 density_zeta, &
937 trim(model), &
938 res%exc_grad)
939 END IF
940#if defined (__HAS_IEEE_EXCEPTIONS)
941 CALL ieee_set_halting_mode(ieee_all, ieee_halt)
942#endif
943 CALL omp_set_num_threads(omp_max_threads_restore)
944 gauxc_return_if_error(status)
945 RETURN
946#endif
947 END IF
948
949 IF (nspins == 1) THEN
950 CALL gauxc_integrator_eval_exc_grad_rks( &
951 status%status, &
952 integrator%integrator, &
953 density_scalar, &
954 res%exc_grad)
955 ELSE
956 cpassert(PRESENT(density_zeta))
957 CALL gauxc_integrator_eval_exc_grad_uks( &
958 status%status, &
959 integrator%integrator, &
960 density_scalar, &
961 density_zeta, &
962 res%exc_grad)
963 END IF
964 gauxc_return_if_error(status)
965
966#else
967 mark_used(density_scalar)
968 mark_used(density_zeta)
969 mark_used(res)
970 mark_used(integrator)
971 mark_used(model)
972 mark_used(natom)
973 mark_used(nspins)
974 mark_used(status)
975 cpabort(no_gauxc_message)
976#endif
977 END FUNCTION gauxc_compute_xc_gradient
978
979! **************************************************************************************************
980!> \brief ...
981!> \param molecule ...
982!> \param status ...
983! **************************************************************************************************
984 SUBROUTINE gauxc_destroy_molecule(molecule, status)
985 TYPE(cp_gauxc_molecule_type), INTENT(INOUT) :: molecule
986 TYPE(cp_gauxc_status_type), INTENT(OUT) :: status
987
988#ifdef __GAUXC
989 CALL gauxc_delete(status%status, molecule%molecule)
990 gauxc_return_if_error(status)
991#else
992 mark_used(molecule)
993 mark_used(status)
994 cpabort(no_gauxc_message)
995#endif
996 END SUBROUTINE gauxc_destroy_molecule
997
998! **************************************************************************************************
999!> \brief ...
1000!> \param basis ...
1001!> \param status ...
1002! **************************************************************************************************
1003 SUBROUTINE gauxc_destroy_basisset(basis, status)
1004 TYPE(cp_gauxc_basisset_type), INTENT(INOUT) :: basis
1005 TYPE(cp_gauxc_status_type), INTENT(OUT) :: status
1006
1007#ifdef __GAUXC
1008 CALL gauxc_delete(status%status, basis%basis)
1009 gauxc_return_if_error(status)
1010#else
1011 mark_used(basis)
1012 mark_used(status)
1013 cpabort(no_gauxc_message)
1014#endif
1015 END SUBROUTINE gauxc_destroy_basisset
1016
1017! **************************************************************************************************
1018!> \brief ...
1019!> \param grid_result ...
1020!> \param status ...
1021! **************************************************************************************************
1022 SUBROUTINE gauxc_destroy_grid(grid_result, status)
1023 TYPE(cp_gauxc_grid_type), INTENT(INOUT) :: grid_result
1024 TYPE(cp_gauxc_status_type), INTENT(OUT) :: status
1025
1026#ifdef __GAUXC
1027 CALL gauxc_delete(status%status, grid_result%mw)
1028 gauxc_return_if_error(status)
1029 CALL gauxc_delete(status%status, grid_result%mwf)
1030 gauxc_return_if_error(status)
1031 CALL gauxc_delete(status%status, grid_result%lb)
1032 gauxc_return_if_error(status)
1033 CALL gauxc_delete(status%status, grid_result%lbf)
1034 gauxc_return_if_error(status)
1035 CALL gauxc_delete(status%status, grid_result%grid)
1036 gauxc_return_if_error(status)
1037 IF (grid_result%owns_rt) THEN
1038 CALL gauxc_runtime_environment_delete(status%status, grid_result%rt)
1039 gauxc_return_if_error(status)
1040 grid_result%owns_rt = .false.
1041 END IF
1042#else
1043 mark_used(grid_result)
1044 mark_used(status)
1045 cpabort(no_gauxc_message)
1046#endif
1047 END SUBROUTINE gauxc_destroy_grid
1048
1049! **************************************************************************************************
1050!> \brief ...
1051!> \param integrator_result ...
1052!> \param status ...
1053! **************************************************************************************************
1054 SUBROUTINE gauxc_destroy_integrator(integrator_result, status)
1055 TYPE(cp_gauxc_integrator_type), INTENT(INOUT) :: integrator_result
1056 TYPE(cp_gauxc_status_type), INTENT(OUT) :: status
1057
1058#ifdef __GAUXC
1059 CALL gauxc_delete(status%status, integrator_result%integrator)
1060 gauxc_return_if_error(status)
1061 CALL gauxc_delete(status%status, integrator_result%func)
1062 gauxc_return_if_error(status)
1063#else
1064 mark_used(integrator_result)
1065 mark_used(status)
1066 cpabort(no_gauxc_message)
1067#endif
1068 END SUBROUTINE gauxc_destroy_integrator
1069
1070! **************************************************************************************************
1071!> \brief Checks gauxc status and prints error message before aborting
1072!> \param status the gauxc status to check
1073! **************************************************************************************************
1074 SUBROUTINE gauxc_check_status(status)
1075 TYPE(cp_gauxc_status_type), INTENT(IN) :: status
1076
1077#ifdef __GAUXC
1078 IF (status%status%code /= 0) THEN
1079 CALL print_gauxc_status_message(status)
1080 cpabort("GauXC returned with non-zero status code")
1081 END IF
1082#else
1083 mark_used(status)
1084#endif
1085 END SUBROUTINE gauxc_check_status
1086
1087!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1088! From here on, it's private helpers !
1089!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1090
1091#ifdef __GAUXC
1092
1093! **************************************************************************************************
1094!> \brief ...
1095!> \param spec ...
1096!> \return ...
1097! **************************************************************************************************
1098 PURE FUNCTION read_execution_space(spec) RESULT(val)
1099 CHARACTER(len=*), INTENT(IN) :: spec
1100 INTEGER(c_int) :: val
1101
1102 CHARACTER(len=LEN(spec)) :: spec_upper
1103
1104 spec_upper = spec
1105 CALL uppercase(spec_upper)
1106
1107 SELECT CASE (spec_upper)
1108 CASE ("HOST")
1109 val = gauxc_executionspace%host
1110 CASE ("DEVICE")
1111 val = gauxc_executionspace%device
1112 CASE DEFAULT
1113 val = gauxc_executionspace%host
1114 END SELECT
1115 END FUNCTION read_execution_space
1116
1117! **************************************************************************************************
1118!> \brief ...
1119!> \param spec ...
1120!> \return ...
1121! **************************************************************************************************
1122 PURE FUNCTION read_atomic_grid_size(spec) RESULT(val)
1123 CHARACTER(len=*), INTENT(IN) :: spec
1124 INTEGER(c_int) :: val
1125
1126 CHARACTER(len=LEN(spec)) :: spec_upper
1127
1128 spec_upper = spec
1129 CALL uppercase(spec_upper)
1130
1131 SELECT CASE (spec_upper)
1132 CASE ("FINE")
1133 val = gauxc_atomicgridsizedefault%finegrid
1134 CASE ("ULTRAFINE")
1135 val = gauxc_atomicgridsizedefault%ultrafinegrid
1136 CASE ("SUPERFINE")
1137 val = gauxc_atomicgridsizedefault%superfinegrid
1138 CASE ("GM3")
1139 val = gauxc_atomicgridsizedefault%gm3
1140 CASE ("GM5")
1141 val = gauxc_atomicgridsizedefault%gm5
1142 CASE DEFAULT
1143 val = gauxc_atomicgridsizedefault%finegrid
1144 END SELECT
1145 END FUNCTION read_atomic_grid_size
1146
1147! **************************************************************************************************
1148!> \brief ...
1149!> \param spec ...
1150!> \return ...
1151! **************************************************************************************************
1152 PURE FUNCTION read_radial_quad(spec) RESULT(val)
1153 CHARACTER(len=*), INTENT(IN) :: spec
1154 INTEGER(c_int) :: val
1155
1156 CHARACTER(len=LEN(spec)) :: spec_upper
1157
1158 spec_upper = spec
1159 CALL uppercase(spec_upper)
1160
1161 SELECT CASE (spec_upper)
1162 CASE ("BECKE")
1163 val = gauxc_radialquad%becke
1164 CASE ("MURAKNOWLES")
1165 val = gauxc_radialquad%mura_knowles
1166 CASE ("TREUTLERAHLRICHS")
1167 val = gauxc_radialquad%treutler_ahlrichs
1168 CASE ("MURRAYHANDYLAMING")
1169 val = gauxc_radialquad%murray_handy_laming
1170 CASE DEFAULT
1171 val = gauxc_radialquad%mura_knowles
1172 END SELECT
1173 END FUNCTION read_radial_quad
1174
1175! **************************************************************************************************
1176!> \brief ...
1177!> \param spec ...
1178!> \return ...
1179! **************************************************************************************************
1180 PURE FUNCTION read_pruning_scheme(spec) RESULT(val)
1181 CHARACTER(len=*), INTENT(IN) :: spec
1182 INTEGER(c_int) :: val
1183
1184 CHARACTER(len=LEN(spec)) :: spec_upper
1185
1186 spec_upper = spec
1187 CALL uppercase(spec_upper)
1188
1189 SELECT CASE (spec_upper)
1190 CASE ("UNPRUNED")
1191 val = gauxc_pruningscheme%unpruned
1192 CASE ("ROBUST")
1193 val = gauxc_pruningscheme%robust
1194 CASE ("TREUTLER")
1195 val = gauxc_pruningscheme%treutler
1196 CASE DEFAULT
1197 val = gauxc_pruningscheme%robust
1198 END SELECT
1199 END FUNCTION read_pruning_scheme
1200
1201#endif
1202
1203! **************************************************************************************************
1204!> \brief Write molecule data to HDF5 file for debugging
1205!> \param molecule ...
1206!> \param output_path ...
1207!> \param filename ...
1208!> \param dataset ...
1209!> \param status ...
1210! **************************************************************************************************
1211 SUBROUTINE gauxc_write_molecule_hdf5(molecule, output_path, filename, dataset, status)
1212 TYPE(cp_gauxc_molecule_type), INTENT(IN) :: molecule
1213 CHARACTER(len=*), INTENT(IN) :: output_path, filename, dataset
1214 TYPE(cp_gauxc_status_type), INTENT(INOUT) :: status
1215
1216#if defined(__GAUXC) && defined(GAUXC_HAS_HDF5)
1217 CHARACTER(len=default_path_length) :: full_path
1218
1219 full_path = trim(output_path)//"/"//trim(filename)
1220 CALL gauxc_write_hdf5_record(status%status, molecule%molecule, full_path, dataset)
1221#else
1222 mark_used(molecule)
1223 mark_used(output_path)
1224 mark_used(filename)
1225 mark_used(dataset)
1226 mark_used(status)
1227 cpabort("GauXC HDF5 output requires GauXC to be built with HDF5 support.")
1228#endif
1229 END SUBROUTINE gauxc_write_molecule_hdf5
1230
1231! **************************************************************************************************
1232!> \brief Write basis set data to HDF5 file for debugging
1233!> \param basis ...
1234!> \param output_path ...
1235!> \param filename ...
1236!> \param dataset ...
1237!> \param status ...
1238! **************************************************************************************************
1239 SUBROUTINE gauxc_write_basisset_hdf5(basis, output_path, filename, dataset, status)
1240 TYPE(cp_gauxc_basisset_type), INTENT(IN) :: basis
1241 CHARACTER(len=*), INTENT(IN) :: output_path, filename, dataset
1242 TYPE(cp_gauxc_status_type), INTENT(INOUT) :: status
1243
1244#if defined(__GAUXC) && defined(GAUXC_HAS_HDF5)
1245 CHARACTER(len=default_path_length) :: full_path
1246
1247 full_path = trim(output_path)//"/"//trim(filename)
1248 CALL gauxc_write_hdf5_record(status%status, basis%basis, full_path, dataset)
1249#else
1250 mark_used(basis)
1251 mark_used(output_path)
1252 mark_used(filename)
1253 mark_used(dataset)
1254 mark_used(status)
1255 cpabort("GauXC HDF5 output requires GauXC to be built with HDF5 support.")
1256#endif
1257 END SUBROUTINE gauxc_write_basisset_hdf5
1258
1259END MODULE xc_gauxc_interface
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind_set(atomic_kind_set, atom_of_kind, kind_of, natom_of_kind, maxatom, natom, nshell, fist_potential_present, shell_present, shell_adiabatic, shell_check_distance, damping_present)
Get attributes of an atomic kind set.
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.
subroutine, public write_gto_basis_set(gto_basis_set, output_unit, header)
Write a Gaussian-type orbital (GTO) basis set data set to the output unit.
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...
Provides integrator routines (velocity verlet) for all the ensemble types.
Definition integrator.F:26
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
integer, parameter, public default_path_length
Definition kinds.F:58
Define the data structure for the particle information.
Periodic Table related data definitions.
subroutine, public get_ptable_info(symbol, number, amass, ielement, covalent_radius, metallic_radius, vdw_radius, found)
Pass information about the kind given the element symbol.
Definition of physical constants:
Definition physcon.F:68
real(kind=dp), parameter, public bohr
Definition physcon.F:147
Some utility functions for the calculation of integrals.
subroutine, public basis_set_list_setup(basis_set_list, basis_type, qs_kind_set)
Set up an easy accessible list of the basis sets for all kinds.
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, cneo_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, monovalent, floating, name, element_symbol, pao_basis_size, pao_model_file, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.
Utilities for string manipulations.
elemental subroutine, public uppercase(string)
Convert all lower case characters in a string to upper case.
Provides all information about an atomic kind.
Provides all information about a quickstep kind.
subroutine print_gauxc_status_message(status)
...