73#include "./base/base_uses.f90"
79 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_cdft_utils'
80 LOGICAL,
PARAMETER,
PRIVATE :: debug_this_module = .false.
99 CHARACTER(len=*),
PARAMETER :: routinen =
'becke_constraint_init'
101 CHARACTER(len=2) :: element_symbol
102 INTEGER :: atom_a, bounds(2), handle, i, iatom, iex, igroup, ikind, ip, ithread, iw, j, &
103 jatom, katom, natom, nkind, npme, nthread, numexp, unit_nr
104 INTEGER,
DIMENSION(2, 3) :: bo
105 INTEGER,
DIMENSION(:),
POINTER :: atom_list, cores, stride
106 LOGICAL :: build, in_memory, mpi_io
107 LOGICAL,
ALLOCATABLE,
DIMENSION(:) :: is_constraint
108 REAL(kind=
dp) :: alpha, chi, coef, eps_cavity, ircov, &
110 REAL(kind=
dp),
DIMENSION(3) :: cell_v, dist_vec, r, r1, ra
111 REAL(kind=
dp),
DIMENSION(:),
POINTER :: radii_list
112 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: pab
126 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
131 NULLIFY (cores, stride, atom_list, cell, para_env, dft_control, &
132 particle_set, logger, cdft_constraint_section, qs_kind_set, &
133 particles, subsys, pab, pw_env, rs_cavity, cavity_env, &
134 auxbas_pw_pool, atomic_kind_set, group, radii_list, cdft_control)
136 CALL timeset(routinen, handle)
139 particle_set=particle_set, &
141 dft_control=dft_control, &
144 iw =
cp_print_key_unit_nr(logger, cdft_constraint_section,
"PROGRAM_RUN_INFO", extension=
".cdftLog")
145 cdft_control => dft_control%qs_control%cdft_control
146 becke_control => cdft_control%becke_control
147 group => cdft_control%group
149 IF (cdft_control%save_pot)
THEN
150 in_memory = becke_control%in_memory
152 IF (becke_control%cavity_confine)
THEN
153 ALLOCATE (is_constraint(natom))
154 is_constraint = .false.
155 DO i = 1, cdft_control%natoms
158 is_constraint(cdft_control%atoms(i)) = .true.
161 eps_cavity = becke_control%eps_cavity
163 IF (becke_control%adjust)
THEN
164 IF (.NOT.
ASSOCIATED(becke_control%radii))
THEN
165 CALL get_qs_env(qs_env, atomic_kind_set=atomic_kind_set)
166 IF (.NOT.
SIZE(atomic_kind_set) ==
SIZE(becke_control%radii_tmp))
THEN
167 CALL cp_abort(__location__, &
168 "Length of keyword BECKE_CONSTRAINT\ATOMIC_RADII does not "// &
169 "match number of atomic kinds in the input coordinate file.")
171 ALLOCATE (becke_control%radii(
SIZE(atomic_kind_set)))
172 becke_control%radii(:) = becke_control%radii_tmp(:)
173 DEALLOCATE (becke_control%radii_tmp)
177 IF (.NOT.
ASSOCIATED(becke_control%cutoffs))
THEN
178 CALL get_qs_env(qs_env, atomic_kind_set=atomic_kind_set)
179 ALLOCATE (becke_control%cutoffs(natom))
180 SELECT CASE (becke_control%cutoff_type)
182 becke_control%cutoffs(:) = becke_control%rglobal
184 IF (.NOT.
SIZE(atomic_kind_set) ==
SIZE(becke_control%cutoffs_tmp))
THEN
185 CALL cp_abort(__location__, &
186 "Length of keyword BECKE_CONSTRAINT\ELEMENT_CUTOFFS does not "// &
187 "match number of atomic kinds in the input coordinate file.")
189 DO ikind = 1,
SIZE(atomic_kind_set)
190 CALL get_atomic_kind(atomic_kind_set(ikind), natom=katom, atom_list=atom_list)
192 atom_a = atom_list(iatom)
193 becke_control%cutoffs(atom_a) = becke_control%cutoffs_tmp(ikind)
196 DEALLOCATE (becke_control%cutoffs_tmp)
200 DO igroup = 1,
SIZE(group)
201 CALL pw_zero(group(igroup)%weight)
203 IF (cdft_control%atomic_charges)
THEN
204 DO iatom = 1, cdft_control%natoms
205 CALL pw_zero(cdft_control%charge(iatom))
210 IF (becke_control%adjust .AND. .NOT.
ASSOCIATED(becke_control%aij))
THEN
211 ALLOCATE (becke_control%aij(natom, natom))
214 IF (becke_control%vector_buffer%store_vectors)
THEN
215 ALLOCATE (becke_control%vector_buffer%distances(natom))
216 ALLOCATE (becke_control%vector_buffer%distance_vecs(3, natom))
217 IF (in_memory)
ALLOCATE (becke_control%vector_buffer%pair_dist_vecs(3, natom, natom))
218 ALLOCATE (becke_control%vector_buffer%position_vecs(3, natom))
220 ALLOCATE (becke_control%vector_buffer%R12(natom, natom))
223 cell_v(i) = cell%hmat(i, i)
225 DO iatom = 1, natom - 1
226 DO jatom = iatom + 1, natom
227 r = particle_set(iatom)%r
228 r1 = particle_set(jatom)%r
230 r(i) =
modulo(r(i), cell%hmat(i, i)) - cell%hmat(i, i)/2._dp
231 r1(i) =
modulo(r1(i), cell%hmat(i, i)) - cell%hmat(i, i)/2._dp
233 dist_vec = (r - r1) - anint((r - r1)/cell_v)*cell_v
235 IF (becke_control%vector_buffer%store_vectors)
THEN
236 becke_control%vector_buffer%position_vecs(:, iatom) = r(:)
237 IF (iatom == 1 .AND. jatom == natom) becke_control%vector_buffer%position_vecs(:, jatom) = r1(:)
239 becke_control%vector_buffer%pair_dist_vecs(:, iatom, jatom) = dist_vec(:)
240 becke_control%vector_buffer%pair_dist_vecs(:, jatom, iatom) = -dist_vec(:)
243 becke_control%vector_buffer%R12(iatom, jatom) = norm2(dist_vec)
244 becke_control%vector_buffer%R12(jatom, iatom) = becke_control%vector_buffer%R12(iatom, jatom)
247 CALL get_atomic_kind(atomic_kind=particle_set(iatom)%atomic_kind, kind_number=ikind)
248 ircov = becke_control%radii(ikind)
249 CALL get_atomic_kind(atomic_kind=particle_set(jatom)%atomic_kind, kind_number=ikind)
250 jrcov = becke_control%radii(ikind)
251 IF (ircov /= jrcov)
THEN
253 uij = (chi - 1.0_dp)/(chi + 1.0_dp)
254 becke_control%aij(iatom, jatom) = uij/(uij**2 - 1.0_dp)
255 IF (becke_control%aij(iatom, jatom) > 0.5_dp)
THEN
256 becke_control%aij(iatom, jatom) = 0.5_dp
257 ELSE IF (becke_control%aij(iatom, jatom) < -0.5_dp)
THEN
258 becke_control%aij(iatom, jatom) = -0.5_dp
261 becke_control%aij(iatom, jatom) = 0.0_dp
264 becke_control%aij(jatom, iatom) = -becke_control%aij(iatom, jatom)
269 IF (cdft_control%first_iteration)
THEN
271 WRITE (iw,
'(/,T3,A)') &
272 '----------------------- Becke atomic parameters ------------------------'
273 IF (becke_control%adjust)
THEN
274 WRITE (iw,
'(T3,A)') &
275 'Atom Element Cutoff (angstrom) CDFT Radius (angstrom)'
277 CALL get_atomic_kind(atomic_kind=particle_set(iatom)%atomic_kind, element_symbol=element_symbol, &
280 WRITE (iw,
"(i6,T15,A2,T37,F8.3,T67,F8.3)") &
281 iatom, adjustr(element_symbol),
cp_unit_from_cp2k(becke_control%cutoffs(iatom),
"angstrom"), &
285 WRITE (iw,
'(T3,A)') &
286 'Atom Element Cutoff (angstrom)'
288 CALL get_atomic_kind(atomic_kind=particle_set(iatom)%atomic_kind, element_symbol=element_symbol)
289 WRITE (iw,
"(i7,T15,A2,T37,F8.3)") &
290 iatom, adjustr(element_symbol),
cp_unit_from_cp2k(becke_control%cutoffs(iatom),
"angstrom")
293 WRITE (iw,
'(T3,A)') &
294 '------------------------------------------------------------------------'
295 WRITE (iw,
'(/,T3,A,T60)') &
296 '----------------------- Becke group definitions ------------------------'
297 DO igroup = 1,
SIZE(group)
298 IF (igroup > 1)
WRITE (iw,
'(T3,A)')
' '
299 WRITE (iw,
'(T5,A,I5,A,I5)') &
300 'Atomic group', igroup,
' of ',
SIZE(group)
301 WRITE (iw,
'(T5,A)')
'Atom Element Coefficient'
302 DO ip = 1,
SIZE(group(igroup)%atoms)
303 iatom = group(igroup)%atoms(ip)
304 CALL get_atomic_kind(atomic_kind=particle_set(iatom)%atomic_kind, element_symbol=element_symbol)
305 WRITE (iw,
'(i8,T16,A2,T23,F8.3)') iatom, adjustr(element_symbol), group(igroup)%coeff(ip)
308 WRITE (iw,
'(T3,A)') &
309 '------------------------------------------------------------------------'
311 cdft_control%first_iteration = .false.
314 IF (becke_control%cavity_confine)
THEN
315 cavity_env => becke_control%cavity_env
316 CALL get_qs_env(qs_env, atomic_kind_set=atomic_kind_set, pw_env=pw_env, qs_kind_set=qs_kind_set)
317 cpassert(
ASSOCIATED(qs_kind_set))
318 nkind =
SIZE(qs_kind_set)
320 IF (.NOT.
ASSOCIATED(cavity_env%kind_shape_fn))
THEN
321 IF (
ASSOCIATED(becke_control%radii))
THEN
322 ALLOCATE (radii_list(
SIZE(becke_control%radii)))
323 DO ikind = 1,
SIZE(becke_control%radii)
324 IF (cavity_env%use_bohr)
THEN
325 radii_list(ikind) = becke_control%radii(ikind)
332 radius=becke_control%rcavity, &
333 radii_list=radii_list)
334 IF (
ASSOCIATED(radii_list))
THEN
335 DEALLOCATE (radii_list)
340 CALL pw_env_get(pw_env, auxbas_rs_grid=rs_cavity, auxbas_pw_pool=auxbas_pw_pool)
345 DO ikind = 1,
SIZE(atomic_kind_set)
346 numexp = cavity_env%kind_shape_fn(ikind)%numexp
347 IF (numexp <= 0) cycle
348 CALL get_atomic_kind(atomic_kind_set(ikind), natom=katom, atom_list=atom_list)
349 ALLOCATE (cores(katom))
351 alpha = cavity_env%kind_shape_fn(ikind)%zet(iex)
352 coef = cavity_env%kind_shape_fn(ikind)%coef(iex)
356 IF (rs_cavity%desc%parallel .AND. .NOT. rs_cavity%desc%distributed)
THEN
358 IF (
modulo(iatom, rs_cavity%desc%group_size) == rs_cavity%desc%my_pos)
THEN
369 atom_a = atom_list(iatom)
371 IF (becke_control%vector_buffer%store_vectors)
THEN
372 ra(:) = becke_control%vector_buffer%position_vecs(:, atom_a) + cell_v(:)/2._dp
374 ra(:) =
pbc(particle_set(atom_a)%r, cell)
376 IF (is_constraint(atom_a))
THEN
378 ra=ra, rb=ra, rp=ra, zetp=alpha, &
379 eps=dft_control%qs_control%eps_rho_rspace, &
380 pab=pab, o1=0, o2=0, &
381 prefactor=1.0_dp, cutoff=0.0_dp)
384 [0.0_dp, 0.0_dp, 0.0_dp], 1.0_dp, &
385 pab, 0, 0, rs_cavity, &
387 use_subpatch=.true., subpatch_pattern=0)
394 CALL auxbas_pw_pool%create_pw(becke_control%cavity)
401 IF (in_memory .OR. cdft_control%save_pot)
THEN
402 CALL hfun_zero(becke_control%cavity%array, eps_cavity, just_bounds=.true., bounds=bounds)
404 bo = group(1)%weight%pw_grid%bounds_local
405 IF (bounds(2) < bo(2, 3))
THEN
406 bounds(2) = bounds(2) - 1
410 IF (bounds(1) > bo(1, 3))
THEN
414 bounds(1) = bounds(1) + 1
418 becke_control%confine_bounds = bounds
421 IF (becke_control%print_cavity)
THEN
422 CALL hfun_zero(becke_control%cavity%array, eps_cavity, just_bounds=.false.)
428 middle_name=
"BECKE_CAVITY", &
429 extension=
".cube", file_position=
"REWIND", &
430 log_filename=.false., mpi_io=mpi_io)
431 IF (para_env%is_source() .AND. unit_nr < 1)
THEN
432 CALL cp_abort(__location__, &
433 "Please turn on PROGRAM_RUN_INFO to print cavity")
437 CALL cp_pw_to_cube(becke_control%cavity, unit_nr,
"CAVITY", particles=particles, stride=stride, mpi_io=mpi_io)
442 IF (
ALLOCATED(is_constraint))
THEN
443 DEALLOCATE (is_constraint)
445 CALL timestop(handle)
465 REAL(kind=
dp),
DIMENSION(:),
POINTER :: rtmplist
469 becke_control => cdft_control%becke_control
470 cpassert(
ASSOCIATED(becke_control))
474 IF (becke_control%adjust)
THEN
476 IF (.NOT. exists) cpabort(
"Keyword ATOMIC_RADII is missing.")
478 cpassert(
SIZE(rtmplist) > 0)
479 ALLOCATE (becke_control%radii_tmp(
SIZE(rtmplist)))
480 DO j = 1,
SIZE(rtmplist)
481 becke_control%radii_tmp(j) = rtmplist(j)
487 SELECT CASE (becke_control%cutoff_type)
492 cpassert(
SIZE(rtmplist) > 0)
493 ALLOCATE (becke_control%cutoffs_tmp(
SIZE(rtmplist)))
494 DO j = 1,
SIZE(rtmplist)
495 becke_control%cutoffs_tmp(j) = rtmplist(j)
503 IF (cdft_control%becke_control%cavity_confine)
THEN
505 IF (becke_control%cavity_shape ==
radius_user .AND. .NOT. becke_control%adjust)
THEN
506 CALL cp_abort(__location__, &
507 "Activate keyword ADJUST_SIZE to use cavity shape USER.")
513 IF (.NOT. cdft_control%becke_control%use_bohr)
THEN
519 radius_type=becke_control%cavity_shape, &
520 use_bohr=becke_control%use_bohr)
533 SUBROUTINE read_constraint_definitions(cdft_control, cdft_control_section)
538 INTEGER :: i, j, jj, k, n_rep, natoms, nvar, &
540 INTEGER,
DIMENSION(:),
POINTER :: atomlist, dummylist, tmplist
541 LOGICAL :: exists, is_duplicate
542 REAL(kind=
dp),
DIMENSION(:),
POINTER :: rtmplist
545 NULLIFY (tmplist, rtmplist, atomlist, dummylist, group_section)
549 IF (.NOT. exists) cpabort(
"Section ATOM_GROUP is missing.")
550 ALLOCATE (cdft_control%group(nvar))
559 IF (
SIZE(tmplist) < 1)
THEN
560 cpabort(
"Each ATOM_GROUP must contain at least 1 atom.")
562 natoms = natoms +
SIZE(tmplist)
564 ALLOCATE (cdft_control%group(k)%atoms(natoms))
565 ALLOCATE (cdft_control%group(k)%coeff(natoms))
566 NULLIFY (cdft_control%group(k)%weight)
567 NULLIFY (cdft_control%group(k)%integrated)
568 tot_natoms = tot_natoms + natoms
573 DO i = 1,
SIZE(tmplist)
575 cdft_control%group(k)%atoms(jj) = tmplist(i)
581 CALL section_vals_val_get(group_section,
"COEFF", i_rep_section=k, i_rep_val=j, r_vals=rtmplist)
582 DO i = 1,
SIZE(rtmplist)
584 IF (jj > natoms) cpabort(
"Length of keywords ATOMS and COEFF must match.")
585 IF (abs(rtmplist(i)) /= 1.0_dp) cpabort(
"Keyword COEFF accepts only values +/-1.0")
586 cdft_control%group(k)%coeff(jj) = rtmplist(i)
589 IF (jj < natoms) cpabort(
"Length of keywords ATOMS and COEFF must match.")
591 i_val=cdft_control%group(k)%constraint_type)
593 l_val=cdft_control%group(k)%is_fragment_constraint)
594 IF (cdft_control%group(k)%is_fragment_constraint) cdft_control%fragment_density = .true.
597 ALLOCATE (atomlist(tot_natoms))
601 DO j = 1,
SIZE(cdft_control%group(k)%atoms)
602 is_duplicate = .false.
604 IF (cdft_control%group(k)%atoms(j) == atomlist(i))
THEN
605 is_duplicate = .true.
609 IF (.NOT. is_duplicate)
THEN
611 atomlist(jj) = cdft_control%group(k)%atoms(j)
617 l_val=cdft_control%atomic_charges)
619 IF (cdft_control%atomic_charges)
THEN
628 IF (
SIZE(tmplist) < 1)
THEN
629 cpabort(
"DUMMY_ATOMS must contain at least 1 atom.")
631 natoms = natoms +
SIZE(tmplist)
633 ALLOCATE (dummylist(natoms))
638 DO i = 1,
SIZE(tmplist)
640 dummylist(jj) = tmplist(i)
646 IF (dummylist(i) == dummylist(j))
THEN
647 cpabort(
"Duplicate atoms defined in section DUMMY_ATOMS.")
652 DO j = 1,
SIZE(atomlist)
653 DO i = 1,
SIZE(dummylist)
654 IF (dummylist(i) == atomlist(j))
THEN
655 CALL cp_abort(__location__, &
656 "Duplicate atoms defined in sections ATOM_GROUP and DUMMY_ATOMS.")
663 IF (
ASSOCIATED(dummylist))
THEN
664 cdft_control%natoms =
SIZE(atomlist) +
SIZE(dummylist)
666 cdft_control%natoms =
SIZE(atomlist)
668 ALLOCATE (cdft_control%atoms(cdft_control%natoms))
669 ALLOCATE (cdft_control%is_constraint(cdft_control%natoms))
670 IF (cdft_control%atomic_charges)
ALLOCATE (cdft_control%charge(cdft_control%natoms))
671 cdft_control%atoms(1:
SIZE(atomlist)) = atomlist
672 IF (
ASSOCIATED(dummylist))
THEN
673 cdft_control%atoms(1 +
SIZE(atomlist):) = dummylist
674 DEALLOCATE (dummylist)
676 cdft_control%is_constraint = .false.
677 cdft_control%is_constraint(1:
SIZE(atomlist)) = .true.
678 DEALLOCATE (atomlist)
680 ALLOCATE (cdft_control%strength(nvar))
681 ALLOCATE (cdft_control%value(nvar))
682 ALLOCATE (cdft_control%target(nvar))
684 IF (
SIZE(rtmplist) /= nvar)
THEN
685 CALL cp_abort(__location__, &
686 "The length of keyword STRENGTH is incorrect. "// &
688 " value(s), got "// &
689 trim(adjustl(
cp_to_string(
SIZE(rtmplist))))//
" value(s).")
692 cdft_control%strength(j) = rtmplist(j)
695 IF (
SIZE(rtmplist) /= nvar)
THEN
696 CALL cp_abort(__location__, &
697 "The length of keyword TARGET is incorrect. "// &
699 " value(s), got "// &
700 trim(adjustl(
cp_to_string(
SIZE(rtmplist))))//
" value(s).")
703 cdft_control%target(j) = rtmplist(j)
706 IF (cdft_control%fragment_density)
THEN
708 c_val=cdft_control%fragment_a_fname)
710 c_val=cdft_control%fragment_b_fname)
712 c_val=cdft_control%fragment_a_spin_fname)
714 c_val=cdft_control%fragment_b_spin_fname)
716 l_val=cdft_control%flip_fragment(1))
718 l_val=cdft_control%flip_fragment(2))
721 END SUBROUTINE read_constraint_definitions
737 hirshfeld_constraint_section, &
738 outer_scf_section, print_section
740 NULLIFY (outer_scf_section, hirshfeld_constraint_section, becke_constraint_section, &
741 print_section, group_section)
742 cdft_control => qs_control%cdft_control
743 cpassert(
ASSOCIATED(cdft_control))
748 i_val=qs_control%cdft_control%type)
752 l_val=cdft_control%reuse_precond)
754 i_val=cdft_control%precond_freq)
756 i_val=cdft_control%max_reuse)
758 l_val=cdft_control%purge_history)
760 i_val=cdft_control%purge_freq)
762 i_val=cdft_control%purge_offset)
764 i_val=cdft_control%ienergy)
770 IF (cdft_control%constraint_control%have_scf)
THEN
772 cpabort(
"Unsupported CDFT constraint.")
775 CALL read_constraint_definitions(cdft_control, cdft_control_section)
777 SELECT CASE (cdft_control%type)
781 IF (.NOT. exists) cpabort(
"BECKE_CONSTRAINT section is missing.")
783 NULLIFY (cdft_control%group(k)%gradients)
789 IF (.NOT. exists) cpabort(
"HIRSHFELD_CONSTRAINT section is missing.")
791 NULLIFY (cdft_control%group(k)%gradients_x)
792 NULLIFY (cdft_control%group(k)%gradients_y)
793 NULLIFY (cdft_control%group(k)%gradients_z)
795 CALL read_hirshfeld_constraint_section(cdft_control, hirshfeld_constraint_section)
797 cpabort(
"Unknown constraint type.")
803 qs_control%cdft = .false.
806 qs_control%cdft = .false.
816 SUBROUTINE read_hirshfeld_constraint_section(cdft_control, hirshfeld_section)
821 REAL(kind=
dp),
DIMENSION(:),
POINTER :: rtmplist
825 hirshfeld_control => cdft_control%hirshfeld_control
826 cpassert(
ASSOCIATED(hirshfeld_control))
828 CALL section_vals_val_get(hirshfeld_section,
"SHAPE_FUNCTION", i_val=hirshfeld_control%shape_function)
829 CALL section_vals_val_get(hirshfeld_section,
"GAUSSIAN_SHAPE", i_val=hirshfeld_control%gaussian_shape)
832 CALL section_vals_val_get(hirshfeld_section,
"USE_ATOMIC_CUTOFF", l_val=hirshfeld_control%use_atomic_cutoff)
833 CALL section_vals_val_get(hirshfeld_section,
"PRINT_DENSITY", l_val=hirshfeld_control%print_density)
835 CALL section_vals_val_get(hirshfeld_section,
"ATOMIC_CUTOFF", r_val=hirshfeld_control%atomic_cutoff)
837 IF (.NOT. hirshfeld_control%use_bohr)
THEN
838 hirshfeld_control%radius =
cp_unit_from_cp2k(hirshfeld_control%radius,
"angstrom")
842 hirshfeld_control%gaussian_shape ==
radius_user)
THEN
844 IF (.NOT. exists) cpabort(
"Keyword ATOMIC_RADII is missing.")
846 cpassert(
SIZE(rtmplist) > 0)
847 ALLOCATE (hirshfeld_control%radii(
SIZE(rtmplist)))
848 hirshfeld_control%radii(:) = rtmplist
853 shape_function_type=hirshfeld_control%shape_function, &
855 radius_type=hirshfeld_control%gaussian_shape, &
856 use_bohr=hirshfeld_control%use_bohr)
858 END SUBROUTINE read_hirshfeld_constraint_section
868 SUBROUTINE hfun_scale(fout, fun1, fun2, divide, small)
869 REAL(kind=
dp),
DIMENSION(:, :, :),
INTENT(OUT) :: fout
870 REAL(kind=
dp),
DIMENSION(:, :, :),
INTENT(IN) :: fun1, fun2
871 LOGICAL,
INTENT(IN) :: divide
872 REAL(kind=
dp),
INTENT(IN) :: small
874 INTEGER :: i1, i2, i3, n1, n2, n3
879 cpassert(n1 ==
SIZE(fun1, 1))
880 cpassert(n2 ==
SIZE(fun1, 2))
881 cpassert(n3 ==
SIZE(fun1, 3))
882 cpassert(n1 ==
SIZE(fun2, 1))
883 cpassert(n2 ==
SIZE(fun2, 2))
884 cpassert(n3 ==
SIZE(fun2, 3))
890 IF (fun2(i1, i2, i3) > small)
THEN
891 fout(i1, i2, i3) = fun1(i1, i2, i3)/fun2(i1, i2, i3)
893 fout(i1, i2, i3) = 0.0_dp
902 fout(i1, i2, i3) = fun1(i1, i2, i3)*fun2(i1, i2, i3)
908 END SUBROUTINE hfun_scale
918 SUBROUTINE hfun_zero(fun, th, just_bounds, bounds)
919 REAL(kind=
dp),
DIMENSION(:, :, :),
INTENT(INOUT) :: fun
920 REAL(kind=
dp),
INTENT(IN) :: th
921 LOGICAL :: just_bounds
922 INTEGER,
OPTIONAL :: bounds(2)
924 INTEGER :: i1, i2, i3, lb, n1, n2, n3, nzeroed, &
926 LOGICAL :: lb_final, ub_final
931 IF (just_bounds)
THEN
932 cpassert(
PRESENT(bounds))
939 IF (just_bounds) nzeroed = 0
941 IF (just_bounds) nzeroed_inner = 0
943 IF (fun(i1, i2, i3) < th)
THEN
944 IF (just_bounds)
THEN
945 nzeroed_inner = nzeroed_inner + 1
947 fun(i1, i2, i3) = 0.0_dp
950 IF (just_bounds)
EXIT
953 IF (just_bounds)
THEN
954 IF (nzeroed_inner < n1)
EXIT
955 nzeroed = nzeroed + nzeroed_inner
958 IF (just_bounds)
THEN
959 IF (nzeroed == (n2*n1))
THEN
960 IF (.NOT. lb_final)
THEN
962 ELSE IF (.NOT. ub_final)
THEN
967 IF (.NOT. lb_final) lb_final = .true.
968 IF (ub_final) ub_final = .false.
972 IF (just_bounds)
THEN
973 IF (.NOT. ub_final) ub = n3
976 bounds = bounds - (n3/2) - 1
979 END SUBROUTINE hfun_zero
989 CHARACTER(len=*),
PARAMETER :: routinen =
'hirshfeld_constraint_init'
991 CHARACTER(len=2) :: element_symbol
992 INTEGER :: handle, iat, iatom, igroup, ikind, ip, &
994 INTEGER,
DIMENSION(:),
POINTER :: atom_list
995 REAL(kind=
dp) :: zeff
996 REAL(kind=
dp),
DIMENSION(:),
POINTER :: radii_list
1006 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1009 NULLIFY (cdft_control, hirshfeld_control, hirshfeld_env, qs_kind_set, atomic_kind_set, &
1010 radii_list, dft_control, group, atomic_kind, atom_list)
1011 CALL timeset(routinen, handle)
1017 CALL get_qs_env(qs_env, dft_control=dft_control)
1018 cdft_control => dft_control%qs_control%cdft_control
1019 hirshfeld_control => cdft_control%hirshfeld_control
1020 hirshfeld_env => hirshfeld_control%hirshfeld_env
1023 IF (.NOT.
ASSOCIATED(hirshfeld_env%kind_shape_fn))
THEN
1024 hirshfeld_env => hirshfeld_control%hirshfeld_env
1025 CALL get_qs_env(qs_env, atomic_kind_set=atomic_kind_set, qs_kind_set=qs_kind_set)
1026 cpassert(
ASSOCIATED(qs_kind_set))
1027 nkind =
SIZE(qs_kind_set)
1029 IF (
ASSOCIATED(hirshfeld_control%radii))
THEN
1030 IF (.NOT.
SIZE(atomic_kind_set) ==
SIZE(hirshfeld_control%radii))
THEN
1031 CALL cp_abort(__location__, &
1032 "Length of keyword HIRSHFELD_CONSTRAINT\ATOMIC_RADII does not "// &
1033 "match number of atomic kinds in the input coordinate file.")
1036 ALLOCATE (radii_list(
SIZE(hirshfeld_control%radii)))
1037 DO ikind = 1,
SIZE(hirshfeld_control%radii)
1038 IF (hirshfeld_control%use_bohr)
THEN
1039 radii_list(ikind) = hirshfeld_control%radii(ikind)
1041 radii_list(ikind) =
cp_unit_from_cp2k(hirshfeld_control%radii(ikind),
"angstrom")
1047 radius=hirshfeld_control%radius, &
1048 radii_list=radii_list)
1049 IF (
ASSOCIATED(radii_list))
DEALLOCATE (radii_list)
1053 IF (.NOT.
ASSOCIATED(hirshfeld_env%charges))
THEN
1054 CALL get_qs_env(qs_env, qs_kind_set=qs_kind_set, atomic_kind_set=atomic_kind_set, &
1055 nkind=nkind, natom=natom)
1056 ALLOCATE (hirshfeld_env%charges(natom))
1059 atomic_kind => atomic_kind_set(ikind)
1061 DO iat = 1,
SIZE(atom_list)
1062 iatom = atom_list(iat)
1063 hirshfeld_env%charges(iatom) = zeff
1069 IF (cdft_control%first_iteration)
THEN
1071 group => cdft_control%group
1072 CALL get_qs_env(qs_env, particle_set=particle_set)
1073 IF (
ASSOCIATED(hirshfeld_control%radii))
THEN
1074 WRITE (iw,
'(T3,A)') &
1075 'Atom Element Gaussian radius (angstrom)'
1077 CALL get_atomic_kind(atomic_kind=particle_set(iatom)%atomic_kind, element_symbol=element_symbol)
1078 WRITE (iw,
"(i7,T15,A2,T37,F8.3)") &
1079 iatom, adjustr(element_symbol),
cp_unit_from_cp2k(hirshfeld_control%radii(iatom),
"angstrom")
1081 WRITE (iw,
'(T3,A)') &
1082 '------------------------------------------------------------------------'
1084 WRITE (iw,
'(/,T3,A,T60)') &
1085 '----------------------- CDFT group definitions -------------------------'
1086 DO igroup = 1,
SIZE(group)
1087 IF (igroup > 1)
WRITE (iw,
'(T3,A)')
' '
1088 WRITE (iw,
'(T5,A,I5,A,I5)') &
1089 'Atomic group', igroup,
' of ',
SIZE(group)
1090 WRITE (iw,
'(T5,A)')
'Atom Element Coefficient'
1091 DO ip = 1,
SIZE(group(igroup)%atoms)
1092 iatom = group(igroup)%atoms(ip)
1093 CALL get_atomic_kind(atomic_kind=particle_set(iatom)%atomic_kind, element_symbol=element_symbol)
1094 WRITE (iw,
'(i8,T16,A2,T23,F8.3)') iatom, adjustr(element_symbol), group(igroup)%coeff(ip)
1097 WRITE (iw,
'(T3,A)') &
1098 '------------------------------------------------------------------------'
1100 cdft_control%first_iteration = .false.
1104 IF (
ASSOCIATED(hirshfeld_control%radii))
DEALLOCATE (hirshfeld_control%radii)
1105 CALL timestop(handle)
1118 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: electronic_charge
1120 CHARACTER(len=2) :: element_symbol
1121 INTEGER :: iatom, ikind, iw, jatom
1122 REAL(kind=
dp) :: tc(2), zeff
1127 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1130 NULLIFY (cdft_constraint_section, logger, particle_set, dft_control, qs_kind_set)
1134 particle_set=particle_set, &
1135 dft_control=dft_control, &
1136 qs_kind_set=qs_kind_set)
1137 cpassert(
ASSOCIATED(qs_kind_set))
1140 iw =
cp_print_key_unit_nr(logger, cdft_constraint_section,
"PROGRAM_RUN_INFO", extension=
".cdftLog")
1141 cdft_control => dft_control%qs_control%cdft_control
1147 IF (cdft_control%print_weight .AND. cdft_control%need_pot)
THEN
1152 IF (iw > 0 .AND. cdft_control%atomic_charges)
THEN
1153 IF (.NOT. cdft_control%fragment_density)
THEN
1154 IF (dft_control%nspins == 1)
THEN
1155 WRITE (iw,
'(/,T3,A)') &
1156 '-------------------------------- CDFT atomic charges --------------------------------'
1157 WRITE (iw,
'(T3,A,A)') &
1158 '#Atom Element Is_constraint',
' Core charge Population (total)'// &
1161 DO iatom = 1, cdft_control%natoms
1162 jatom = cdft_control%atoms(iatom)
1164 element_symbol=element_symbol, &
1167 WRITE (iw,
"(i7,T15,A2,T23,L10,T39,F8.3,T61,F8.3,T81,F8.3)") &
1168 jatom, adjustr(element_symbol), cdft_control%is_constraint(iatom), zeff, electronic_charge(iatom, 1), &
1169 (zeff - electronic_charge(iatom, 1))
1170 tc(1) = tc(1) + (zeff - electronic_charge(iatom, 1))
1172 WRITE (iw,
'(/,T3,A,T81,F8.3,/)')
"Total Charge: ", tc(1)
1174 WRITE (iw,
'(/,T3,A)') &
1175 '------------------------------------------ CDFT atomic charges -------------------------------------------'
1176 WRITE (iw,
'(T3,A,A)') &
1177 '#Atom Element Is_constraint',
' Core charge Population (alpha, beta)'// &
1178 ' Net charge Spin population'
1180 DO iatom = 1, cdft_control%natoms
1181 jatom = cdft_control%atoms(iatom)
1183 element_symbol=element_symbol, &
1186 WRITE (iw,
"(i7,T15,A2,T23,L10,T39,F8.3,T53,F8.3,T67,F8.3,T81,F8.3,T102,F8.3)") &
1187 jatom, adjustr(element_symbol), &
1188 cdft_control%is_constraint(iatom), &
1189 zeff, electronic_charge(iatom, 1), electronic_charge(iatom, 2), &
1190 (zeff - electronic_charge(iatom, 1) - electronic_charge(iatom, 2)), &
1191 electronic_charge(iatom, 1) - electronic_charge(iatom, 2)
1192 tc(1) = tc(1) + (zeff - electronic_charge(iatom, 1) - electronic_charge(iatom, 2))
1193 tc(2) = tc(2) + (electronic_charge(iatom, 1) - electronic_charge(iatom, 2))
1195 WRITE (iw,
'(/,T3,A,T81,F8.3,T102,F8.3/)')
"Total Charge and Spin Moment: ", tc(1), tc(2)
1199 WRITE (iw,
'(/,T3,A)') &
1200 '-------------------------------- CDFT atomic charges --------------------------------'
1201 IF (dft_control%nspins == 1)
THEN
1202 WRITE (iw,
'(T3,A,A)') &
1203 '#Atom Element Is_constraint',
' Fragment charge Population (total)'// &
1206 WRITE (iw,
'(T3,A,A)') &
1207 '#Atom Element Is_constraint',
' Fragment charge Population (alpha, beta)'// &
1211 DO iatom = 1, cdft_control%natoms
1212 jatom = cdft_control%atoms(iatom)
1214 element_symbol=element_symbol, &
1216 IF (dft_control%nspins == 1)
THEN
1217 WRITE (iw,
"(i7,T15,A2,T23,L10,T43,F8.3,T65,F8.3,T81,F8.3)") &
1218 jatom, adjustr(element_symbol), &
1219 cdft_control%is_constraint(iatom), &
1220 cdft_control%charges_fragment(iatom, 1), &
1221 electronic_charge(iatom, 1), &
1222 (electronic_charge(iatom, 1) - &
1223 cdft_control%charges_fragment(iatom, 1))
1224 tc(1) = tc(1) + (electronic_charge(iatom, 1) - &
1225 cdft_control%charges_fragment(iatom, 1))
1227 WRITE (iw,
"(i7,T15,A2,T23,L10,T43,F8.3,T57,F8.3,T69,F8.3,T81,F8.3)") &
1228 jatom, adjustr(element_symbol), &
1229 cdft_control%is_constraint(iatom), &
1230 cdft_control%charges_fragment(iatom, 1), &
1231 electronic_charge(iatom, 1), electronic_charge(iatom, 2), &
1232 (electronic_charge(iatom, 1) + electronic_charge(iatom, 2) - &
1233 cdft_control%charges_fragment(iatom, 1))
1234 tc(1) = tc(1) + (electronic_charge(iatom, 1) + electronic_charge(iatom, 2) - &
1235 cdft_control%charges_fragment(iatom, 1))
1238 WRITE (iw,
'(/,T3,A,T81,F8.3,/)')
"Total Charge: ", tc(1)
1240 WRITE (iw,
'(/,T3,A)') &
1241 '------------------------------------------ CDFT atomic charges -------------------------------------------'
1242 WRITE (iw,
'(T3,A,A)') &
1243 '#Atom Element Is_constraint',
' Fragment charge/spin moment'// &
1244 ' Population (alpha, beta) Net charge/spin moment'
1246 DO iatom = 1, cdft_control%natoms
1247 jatom = cdft_control%atoms(iatom)
1249 element_symbol=element_symbol, &
1251 WRITE (iw,
"(i7,T15,A2,T22,L10,T40,F8.3,T52,F8.3,T66,F8.3,T78,F8.3,T90,F8.3,T102,F8.3)") &
1252 jatom, adjustr(element_symbol), &
1253 cdft_control%is_constraint(iatom), &
1254 cdft_control%charges_fragment(iatom, 1), &
1255 cdft_control%charges_fragment(iatom, 2), &
1256 electronic_charge(iatom, 1), electronic_charge(iatom, 2), &
1257 (electronic_charge(iatom, 1) + electronic_charge(iatom, 2) - &
1258 cdft_control%charges_fragment(iatom, 1)), &
1259 (electronic_charge(iatom, 1) - electronic_charge(iatom, 2) - &
1260 cdft_control%charges_fragment(iatom, 2))
1261 tc(1) = tc(1) + (electronic_charge(iatom, 1) + electronic_charge(iatom, 2) - &
1262 cdft_control%charges_fragment(iatom, 1))
1263 tc(2) = tc(2) + (electronic_charge(iatom, 1) - electronic_charge(iatom, 2) - &
1264 cdft_control%charges_fragment(iatom, 2))
1266 WRITE (iw,
'(/,T3,A,T90,F8.3,T102,F8.3/)')
"Total Charge and Spin Moment: ", tc(1), tc(2)
1280 CHARACTER(LEN=default_path_length) :: middle_name
1281 INTEGER :: igroup, unit_nr
1291 NULLIFY (cdft_constraint_section, logger, particles, dft_control, &
1292 para_env, subsys, cdft_control)
1295 CALL get_qs_env(qs_env, subsys=subsys, para_env=para_env, dft_control=dft_control)
1297 cdft_control => dft_control%qs_control%cdft_control
1300 DO igroup = 1,
SIZE(cdft_control%group)
1302 middle_name =
"cdft_weight_"//trim(adjustl(
cp_to_string(igroup)))
1304 middle_name=middle_name, &
1305 extension=
".cube", file_position=
"REWIND", &
1306 log_filename=.false., mpi_io=mpi_io)
1308 IF (para_env%is_source() .AND. unit_nr < 1)
THEN
1309 CALL cp_abort(__location__, &
1310 "Please turn on PROGRAM_RUN_INFO to print CDFT weight function.")
1315 "CDFT Weight Function", &
1316 particles=particles, &
1317 stride=
section_get_ivals(cdft_constraint_section,
"PROGRAM_RUN_INFO%WEIGHT_FUNCTION%STRIDE"), &
1331 CHARACTER(LEN=default_path_length) :: middle_name
1332 INTEGER :: iatom, igroup, unit_nr
1343 NULLIFY (cdft_constraint_section, logger, particles, dft_control, &
1344 para_env, subsys, cdft_control, pw_env)
1347 CALL get_qs_env(qs_env, subsys=subsys, para_env=para_env, dft_control=dft_control, pw_env=pw_env)
1349 cdft_control => dft_control%qs_control%cdft_control
1354 DO igroup = 1,
SIZE(cdft_control%group)
1356 middle_name =
"hw_rho_total"//trim(adjustl(
cp_to_string(igroup)))
1357 unit_nr =
cp_print_key_unit_nr(logger, cdft_constraint_section,
"PROGRAM_RUN_INFO", mpi_io=mpi_io, &
1358 file_position=
"REWIND", middle_name=middle_name, extension=
".cube")
1360 CALL cp_pw_to_cube(cdft_control%hw_rho_total, unit_nr,
"CDFT Weight Function", mpi_io=mpi_io, &
1361 particles=particles, stride=
section_get_ivals(cdft_constraint_section,
"PROGRAM_RUN_INFO%WEIGHT_FUNCTION%STRIDE"))
1367 DO igroup = 1,
SIZE(cdft_control%group)
1369 middle_name =
"hw_rho_total_constraint_"//trim(adjustl(
cp_to_string(igroup)))
1370 unit_nr =
cp_print_key_unit_nr(logger, cdft_constraint_section,
"PROGRAM_RUN_INFO", mpi_io=mpi_io, &
1371 file_position=
"REWIND", middle_name=middle_name, extension=
".cube")
1373 CALL cp_pw_to_cube(cdft_control%group(igroup)%hw_rho_total_constraint, unit_nr, &
1374 "CDFT Weight Function", mpi_io=mpi_io, particles=particles, &
1375 stride=
section_get_ivals(cdft_constraint_section,
"PROGRAM_RUN_INFO%WEIGHT_FUNCTION%STRIDE"))
1381 DO igroup = 1,
SIZE(cdft_control%group)
1382 DO iatom = 1, (cdft_control%natoms)
1384 middle_name =
"hw_rho_atomic_"//trim(adjustl(
cp_to_string(iatom)))
1385 unit_nr =
cp_print_key_unit_nr(logger, cdft_constraint_section,
"PROGRAM_RUN_INFO", mpi_io=mpi_io, &
1386 file_position=
"REWIND", middle_name=middle_name, extension=
".cube")
1388 CALL cp_pw_to_cube(cdft_control%group(igroup)%hw_rho_atomic(iatom), unit_nr, &
1389 "CDFT Weight Function", mpi_io=mpi_io, particles=particles, &
1390 stride=
section_get_ivals(cdft_constraint_section,
"PROGRAM_RUN_INFO%WEIGHT_FUNCTION%STRIDE"))
static GRID_HOST_DEVICE int modulo(int a, int m)
Equivalent of Fortran's MODULO, which always return a positive number. https://gcc....
All kind of helpful little routines.
real(kind=dp) function, public exp_radius_very_extended(la_min, la_max, lb_min, lb_max, pab, o1, o2, ra, rb, rp, zetp, eps, prefactor, cutoff, epsabs)
computes the radius of the Gaussian outside of which it is smaller than eps
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.
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public holmberg2017
integer, save, public holmberg2018
integer, save, public becke1988b
Handles all functions related to the CELL.
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
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,...
A wrapper around pw_to_cube() which accepts particle_list_type.
subroutine, public cp_pw_to_cube(pw, unit_nr, title, particles, zeff, stride, max_file_size_mb, zero_tails, silent, mpi_io)
...
real(kind=dp) function, public cp_unit_from_cp2k(value, unit_str, defaults, power)
converts from the internal cp2k units to the given unit
Fortran API for the grid package, which is written in C.
integer, parameter, public grid_func_ab
subroutine, public collocate_pgf_product(la_max, zeta, la_min, lb_max, zetb, lb_min, ra, rab, scale, pab, o1, o2, rsgrid, ga_gb_function, radius, use_subpatch, subpatch_pattern)
low level collocation of primitive gaussian functions
Calculate Hirshfeld charges and related functions.
subroutine, public create_shape_function(hirshfeld_env, qs_kind_set, atomic_kind_set, radius, radii_list)
creates kind specific shape functions for Hirshfeld charges
The types needed for the calculation of Hirshfeld charges and related functions.
subroutine, public create_hirshfeld_type(hirshfeld_env)
...
subroutine, public set_hirshfeld_info(hirshfeld_env, shape_function_type, iterative, ref_charge, fnorm, radius_type, use_bohr)
Set values of a Hirshfeld env.
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_path_length
Utility routines for the memory handling.
Interface to the message passing library MPI.
parameters that control the outer loop of an SCF iteration
subroutine, public outer_scf_read_parameters(outer_scf, outer_scf_section)
reads the parameters of the outer_scf section into the given outer_scf
represent a simple array based list of the given type
Define the data structure for the particle information.
container for various plainwaves related things
subroutine, public pw_env_get(pw_env, pw_pools, cube_info, gridlevel_info, auxbas_pw_pool, auxbas_grid, auxbas_rs_desc, auxbas_rs_grid, rs_descs, rs_grids, xc_pw_pool, vdw_pw_pool, poisson_env, interp_section)
returns the various attributes of the pw env
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
Defines CDFT control structures.
Utility subroutines for CDFT calculations.
subroutine, public read_cdft_control_section(qs_control, cdft_control_section)
reads the input parameters needed for CDFT with OT
subroutine, public cdft_constraint_print(qs_env, electronic_charge)
Prints information about CDFT constraints.
subroutine, public hirshfeld_constraint_init(qs_env)
Initializes Gaussian Hirshfeld constraints.
subroutine, public cdft_print_weight_function(qs_env)
Prints CDFT weight functions to cube files.
subroutine, public becke_constraint_init(qs_env)
Initializes the Becke constraint environment.
subroutine, public read_becke_section(cdft_control, becke_section)
reads the input parameters specific to Becke-based CDFT constraints
subroutine, public cdft_print_hirshfeld_density(qs_env)
Prints Hirshfeld weight function and promolecule density.
subroutine, public get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, cell_ref, use_ref_cell, kpoints, dft_control, mos, sab_orb, sab_all, qmmm, qmmm_periodic, mimic, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, sab_cneo, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, matrix_vhxc, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, xcint_weights, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, rhoz_cneo_set, ecoul_1c, rho0_s_rs, rho0_s_gs, rhoz_cneo_s_rs, rhoz_cneo_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, harris_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, wanniercentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs, do_rixs, tb_tblite)
Get the QUICKSTEP environment.
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, hund_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, proj_shell_charge, lr_atom, do_mtlr, u_j_loop, ao_coef, 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.
subroutine, public qs_scf_cdft_constraint_info(output_unit, cdft_control)
writes CDFT constraint information
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)
...
subroutine, public transfer_rs2pw(rs, pw)
...
subroutine, public rs_grid_zero(rs)
Initialize grid to zero.
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
type of a logger, at the moment it contains just a print level starting at which level it should be l...
quantities needed for a Hirshfeld based partitioning of real space
stores all the informations relevant to an mpi environment
represent a list of objects
contained for different pw related things
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
control parameters for CDFT simulations
Provides all information about a quickstep kind.