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)) &
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.")
170 ALLOCATE (becke_control%radii(
SIZE(atomic_kind_set)))
171 becke_control%radii(:) = becke_control%radii_tmp(:)
172 DEALLOCATE (becke_control%radii_tmp)
176 IF (.NOT.
ASSOCIATED(becke_control%cutoffs))
THEN
177 CALL get_qs_env(qs_env, atomic_kind_set=atomic_kind_set)
178 ALLOCATE (becke_control%cutoffs(natom))
179 SELECT CASE (becke_control%cutoff_type)
181 becke_control%cutoffs(:) = becke_control%rglobal
183 IF (.NOT.
SIZE(atomic_kind_set) ==
SIZE(becke_control%cutoffs_tmp)) &
184 CALL cp_abort(__location__, &
185 "Length of keyword BECKE_CONSTRAINT\ELEMENT_CUTOFFS does not "// &
186 "match number of atomic kinds in the input coordinate file.")
187 DO ikind = 1,
SIZE(atomic_kind_set)
188 CALL get_atomic_kind(atomic_kind_set(ikind), natom=katom, atom_list=atom_list)
190 atom_a = atom_list(iatom)
191 becke_control%cutoffs(atom_a) = becke_control%cutoffs_tmp(ikind)
194 DEALLOCATE (becke_control%cutoffs_tmp)
198 DO igroup = 1,
SIZE(group)
199 CALL pw_zero(group(igroup)%weight)
201 IF (cdft_control%atomic_charges)
THEN
202 DO iatom = 1, cdft_control%natoms
203 CALL pw_zero(cdft_control%charge(iatom))
208 IF (becke_control%adjust .AND. .NOT.
ASSOCIATED(becke_control%aij))
THEN
209 ALLOCATE (becke_control%aij(natom, natom))
212 IF (becke_control%vector_buffer%store_vectors)
THEN
213 ALLOCATE (becke_control%vector_buffer%distances(natom))
214 ALLOCATE (becke_control%vector_buffer%distance_vecs(3, natom))
215 IF (in_memory)
ALLOCATE (becke_control%vector_buffer%pair_dist_vecs(3, natom, natom))
216 ALLOCATE (becke_control%vector_buffer%position_vecs(3, natom))
218 ALLOCATE (becke_control%vector_buffer%R12(natom, natom))
221 cell_v(i) = cell%hmat(i, i)
223 DO iatom = 1, natom - 1
224 DO jatom = iatom + 1, natom
225 r = particle_set(iatom)%r
226 r1 = particle_set(jatom)%r
228 r(i) =
modulo(r(i), cell%hmat(i, i)) - cell%hmat(i, i)/2._dp
229 r1(i) =
modulo(r1(i), cell%hmat(i, i)) - cell%hmat(i, i)/2._dp
231 dist_vec = (r - r1) - anint((r - r1)/cell_v)*cell_v
233 IF (becke_control%vector_buffer%store_vectors)
THEN
234 becke_control%vector_buffer%position_vecs(:, iatom) = r(:)
235 IF (iatom == 1 .AND. jatom == natom) becke_control%vector_buffer%position_vecs(:, jatom) = r1(:)
237 becke_control%vector_buffer%pair_dist_vecs(:, iatom, jatom) = dist_vec(:)
238 becke_control%vector_buffer%pair_dist_vecs(:, jatom, iatom) = -dist_vec(:)
241 becke_control%vector_buffer%R12(iatom, jatom) = sqrt(dot_product(dist_vec, dist_vec))
242 becke_control%vector_buffer%R12(jatom, iatom) = becke_control%vector_buffer%R12(iatom, jatom)
245 CALL get_atomic_kind(atomic_kind=particle_set(iatom)%atomic_kind, kind_number=ikind)
246 ircov = becke_control%radii(ikind)
247 CALL get_atomic_kind(atomic_kind=particle_set(jatom)%atomic_kind, kind_number=ikind)
248 jrcov = becke_control%radii(ikind)
249 IF (ircov .NE. jrcov)
THEN
251 uij = (chi - 1.0_dp)/(chi + 1.0_dp)
252 becke_control%aij(iatom, jatom) = uij/(uij**2 - 1.0_dp)
253 IF (becke_control%aij(iatom, jatom) .GT. 0.5_dp)
THEN
254 becke_control%aij(iatom, jatom) = 0.5_dp
255 ELSE IF (becke_control%aij(iatom, jatom) .LT. -0.5_dp)
THEN
256 becke_control%aij(iatom, jatom) = -0.5_dp
259 becke_control%aij(iatom, jatom) = 0.0_dp
262 becke_control%aij(jatom, iatom) = -becke_control%aij(iatom, jatom)
267 IF (cdft_control%first_iteration)
THEN
269 WRITE (iw,
'(/,T3,A)') &
270 '----------------------- Becke atomic parameters ------------------------'
271 IF (becke_control%adjust)
THEN
272 WRITE (iw,
'(T3,A)') &
273 'Atom Element Cutoff (angstrom) CDFT Radius (angstrom)'
275 CALL get_atomic_kind(atomic_kind=particle_set(iatom)%atomic_kind, element_symbol=element_symbol, &
278 WRITE (iw,
"(i6,T15,A2,T37,F8.3,T67,F8.3)") &
279 iatom, adjustr(element_symbol),
cp_unit_from_cp2k(becke_control%cutoffs(iatom),
"angstrom"), &
283 WRITE (iw,
'(T3,A)') &
284 'Atom Element Cutoff (angstrom)'
286 CALL get_atomic_kind(atomic_kind=particle_set(iatom)%atomic_kind, element_symbol=element_symbol)
287 WRITE (iw,
"(i7,T15,A2,T37,F8.3)") &
288 iatom, adjustr(element_symbol),
cp_unit_from_cp2k(becke_control%cutoffs(iatom),
"angstrom")
291 WRITE (iw,
'(T3,A)') &
292 '------------------------------------------------------------------------'
293 WRITE (iw,
'(/,T3,A,T60)') &
294 '----------------------- Becke group definitions ------------------------'
295 DO igroup = 1,
SIZE(group)
296 IF (igroup > 1)
WRITE (iw,
'(T3,A)')
' '
297 WRITE (iw,
'(T5,A,I5,A,I5)') &
298 'Atomic group', igroup,
' of ',
SIZE(group)
299 WRITE (iw,
'(T5,A)')
'Atom Element Coefficient'
300 DO ip = 1,
SIZE(group(igroup)%atoms)
301 iatom = group(igroup)%atoms(ip)
302 CALL get_atomic_kind(atomic_kind=particle_set(iatom)%atomic_kind, element_symbol=element_symbol)
303 WRITE (iw,
'(i8,T16,A2,T23,F8.3)') iatom, adjustr(element_symbol), group(igroup)%coeff(ip)
306 WRITE (iw,
'(T3,A)') &
307 '------------------------------------------------------------------------'
309 cdft_control%first_iteration = .false.
312 IF (becke_control%cavity_confine)
THEN
313 cavity_env => becke_control%cavity_env
314 CALL get_qs_env(qs_env, atomic_kind_set=atomic_kind_set, pw_env=pw_env, qs_kind_set=qs_kind_set)
315 cpassert(
ASSOCIATED(qs_kind_set))
316 nkind =
SIZE(qs_kind_set)
318 IF (.NOT.
ASSOCIATED(cavity_env%kind_shape_fn))
THEN
319 IF (
ASSOCIATED(becke_control%radii))
THEN
320 ALLOCATE (radii_list(
SIZE(becke_control%radii)))
321 DO ikind = 1,
SIZE(becke_control%radii)
322 IF (cavity_env%use_bohr)
THEN
323 radii_list(ikind) = becke_control%radii(ikind)
330 radius=becke_control%rcavity, &
331 radii_list=radii_list)
332 IF (
ASSOCIATED(radii_list)) &
333 DEALLOCATE (radii_list)
337 CALL pw_env_get(pw_env, auxbas_rs_grid=rs_cavity, auxbas_pw_pool=auxbas_pw_pool)
342 DO ikind = 1,
SIZE(atomic_kind_set)
343 numexp = cavity_env%kind_shape_fn(ikind)%numexp
344 IF (numexp <= 0) cycle
345 CALL get_atomic_kind(atomic_kind_set(ikind), natom=katom, atom_list=atom_list)
346 ALLOCATE (cores(katom))
348 alpha = cavity_env%kind_shape_fn(ikind)%zet(iex)
349 coef = cavity_env%kind_shape_fn(ikind)%coef(iex)
353 IF (rs_cavity%desc%parallel .AND. .NOT. rs_cavity%desc%distributed)
THEN
355 IF (
modulo(iatom, rs_cavity%desc%group_size) == rs_cavity%desc%my_pos)
THEN
366 atom_a = atom_list(iatom)
368 IF (becke_control%vector_buffer%store_vectors)
THEN
369 ra(:) = becke_control%vector_buffer%position_vecs(:, atom_a) + cell_v(:)/2._dp
371 ra(:) =
pbc(particle_set(atom_a)%r, cell)
373 IF (is_constraint(atom_a))
THEN
375 ra=ra, rb=ra, rp=ra, zetp=alpha, &
376 eps=dft_control%qs_control%eps_rho_rspace, &
377 pab=pab, o1=0, o2=0, &
378 prefactor=1.0_dp, cutoff=0.0_dp)
381 (/0.0_dp, 0.0_dp, 0.0_dp/), 1.0_dp, &
382 pab, 0, 0, rs_cavity, &
384 use_subpatch=.true., subpatch_pattern=0)
391 CALL auxbas_pw_pool%create_pw(becke_control%cavity)
398 IF (in_memory .OR. cdft_control%save_pot)
THEN
399 CALL hfun_zero(becke_control%cavity%array, eps_cavity, just_bounds=.true., bounds=bounds)
401 bo = group(1)%weight%pw_grid%bounds_local
402 IF (bounds(2) .LT. bo(2, 3))
THEN
403 bounds(2) = bounds(2) - 1
407 IF (bounds(1) .GT. bo(1, 3))
THEN
411 bounds(1) = bounds(1) + 1
415 becke_control%confine_bounds = bounds
418 IF (becke_control%print_cavity)
THEN
419 CALL hfun_zero(becke_control%cavity%array, eps_cavity, just_bounds=.false.)
425 middle_name=
"BECKE_CAVITY", &
426 extension=
".cube", file_position=
"REWIND", &
427 log_filename=.false., mpi_io=mpi_io)
428 IF (para_env%is_source() .AND. unit_nr .LT. 1) &
429 CALL cp_abort(__location__, &
430 "Please turn on PROGRAM_RUN_INFO to print cavity")
433 CALL cp_pw_to_cube(becke_control%cavity, unit_nr,
"CAVITY", particles=particles, stride=stride, mpi_io=mpi_io)
438 IF (
ALLOCATED(is_constraint)) &
439 DEALLOCATE (is_constraint)
440 CALL timestop(handle)
460 REAL(kind=
dp),
DIMENSION(:),
POINTER :: rtmplist
464 becke_control => cdft_control%becke_control
465 cpassert(
ASSOCIATED(becke_control))
469 IF (becke_control%adjust)
THEN
471 IF (.NOT. exists) cpabort(
"Keyword ATOMIC_RADII is missing.")
473 cpassert(
SIZE(rtmplist) > 0)
474 ALLOCATE (becke_control%radii_tmp(
SIZE(rtmplist)))
475 DO j = 1,
SIZE(rtmplist)
476 becke_control%radii_tmp(j) = rtmplist(j)
482 SELECT CASE (becke_control%cutoff_type)
487 cpassert(
SIZE(rtmplist) > 0)
488 ALLOCATE (becke_control%cutoffs_tmp(
SIZE(rtmplist)))
489 DO j = 1,
SIZE(rtmplist)
490 becke_control%cutoffs_tmp(j) = rtmplist(j)
498 IF (cdft_control%becke_control%cavity_confine)
THEN
500 IF (becke_control%cavity_shape ==
radius_user .AND. .NOT. becke_control%adjust) &
501 CALL cp_abort(__location__, &
502 "Activate keyword ADJUST_SIZE to use cavity shape USER.")
507 IF (.NOT. cdft_control%becke_control%use_bohr)
THEN
513 radius_type=becke_control%cavity_shape, &
514 use_bohr=becke_control%use_bohr)
527 SUBROUTINE read_constraint_definitions(cdft_control, cdft_control_section)
532 INTEGER :: i, j, jj, k, n_rep, natoms, nvar, &
534 INTEGER,
DIMENSION(:),
POINTER :: atomlist, dummylist, tmplist
535 LOGICAL :: exists, is_duplicate
536 REAL(kind=
dp),
DIMENSION(:),
POINTER :: rtmplist
539 NULLIFY (tmplist, rtmplist, atomlist, dummylist, group_section)
543 IF (.NOT. exists) cpabort(
"Section ATOM_GROUP is missing.")
544 ALLOCATE (cdft_control%group(nvar))
553 IF (
SIZE(tmplist) < 1) &
554 cpabort(
"Each ATOM_GROUP must contain at least 1 atom.")
555 natoms = natoms +
SIZE(tmplist)
557 ALLOCATE (cdft_control%group(k)%atoms(natoms))
558 ALLOCATE (cdft_control%group(k)%coeff(natoms))
559 NULLIFY (cdft_control%group(k)%weight)
560 NULLIFY (cdft_control%group(k)%integrated)
561 tot_natoms = tot_natoms + natoms
566 DO i = 1,
SIZE(tmplist)
568 cdft_control%group(k)%atoms(jj) = tmplist(i)
574 CALL section_vals_val_get(group_section,
"COEFF", i_rep_section=k, i_rep_val=j, r_vals=rtmplist)
575 DO i = 1,
SIZE(rtmplist)
577 IF (jj > natoms) cpabort(
"Length of keywords ATOMS and COEFF must match.")
578 IF (abs(rtmplist(i)) /= 1.0_dp) cpabort(
"Keyword COEFF accepts only values +/-1.0")
579 cdft_control%group(k)%coeff(jj) = rtmplist(i)
582 IF (jj < natoms) cpabort(
"Length of keywords ATOMS and COEFF must match.")
584 i_val=cdft_control%group(k)%constraint_type)
586 l_val=cdft_control%group(k)%is_fragment_constraint)
587 IF (cdft_control%group(k)%is_fragment_constraint) cdft_control%fragment_density = .true.
590 ALLOCATE (atomlist(tot_natoms))
594 DO j = 1,
SIZE(cdft_control%group(k)%atoms)
595 is_duplicate = .false.
597 IF (cdft_control%group(k)%atoms(j) == atomlist(i))
THEN
598 is_duplicate = .true.
602 IF (.NOT. is_duplicate)
THEN
604 atomlist(jj) = cdft_control%group(k)%atoms(j)
610 l_val=cdft_control%atomic_charges)
612 IF (cdft_control%atomic_charges)
THEN
621 IF (
SIZE(tmplist) < 1) &
622 cpabort(
"DUMMY_ATOMS must contain at least 1 atom.")
623 natoms = natoms +
SIZE(tmplist)
625 ALLOCATE (dummylist(natoms))
630 DO i = 1,
SIZE(tmplist)
632 dummylist(jj) = tmplist(i)
638 IF (dummylist(i) == dummylist(j)) &
639 cpabort(
"Duplicate atoms defined in section DUMMY_ATOMS.")
643 DO j = 1,
SIZE(atomlist)
644 DO i = 1,
SIZE(dummylist)
645 IF (dummylist(i) == atomlist(j)) &
646 CALL cp_abort(__location__, &
647 "Duplicate atoms defined in sections ATOM_GROUP and DUMMY_ATOMS.")
653 IF (
ASSOCIATED(dummylist))
THEN
654 cdft_control%natoms =
SIZE(atomlist) +
SIZE(dummylist)
656 cdft_control%natoms =
SIZE(atomlist)
658 ALLOCATE (cdft_control%atoms(cdft_control%natoms))
659 ALLOCATE (cdft_control%is_constraint(cdft_control%natoms))
660 IF (cdft_control%atomic_charges)
ALLOCATE (cdft_control%charge(cdft_control%natoms))
661 cdft_control%atoms(1:
SIZE(atomlist)) = atomlist
662 IF (
ASSOCIATED(dummylist))
THEN
663 cdft_control%atoms(1 +
SIZE(atomlist):) = dummylist
664 DEALLOCATE (dummylist)
666 cdft_control%is_constraint = .false.
667 cdft_control%is_constraint(1:
SIZE(atomlist)) = .true.
668 DEALLOCATE (atomlist)
670 ALLOCATE (cdft_control%strength(nvar))
671 ALLOCATE (cdft_control%value(nvar))
672 ALLOCATE (cdft_control%target(nvar))
674 IF (
SIZE(rtmplist) /= nvar) &
675 CALL cp_abort(__location__, &
676 "The length of keyword STRENGTH is incorrect. "// &
678 " value(s), got "// &
679 trim(adjustl(
cp_to_string(
SIZE(rtmplist))))//
" value(s).")
681 cdft_control%strength(j) = rtmplist(j)
684 IF (
SIZE(rtmplist) /= nvar) &
685 CALL cp_abort(__location__, &
686 "The length of keyword TARGET is incorrect. "// &
688 " value(s), got "// &
689 trim(adjustl(
cp_to_string(
SIZE(rtmplist))))//
" value(s).")
691 cdft_control%target(j) = rtmplist(j)
694 IF (cdft_control%fragment_density)
THEN
696 c_val=cdft_control%fragment_a_fname)
698 c_val=cdft_control%fragment_b_fname)
700 c_val=cdft_control%fragment_a_spin_fname)
702 c_val=cdft_control%fragment_b_spin_fname)
704 l_val=cdft_control%flip_fragment(1))
706 l_val=cdft_control%flip_fragment(2))
709 END SUBROUTINE read_constraint_definitions
725 hirshfeld_constraint_section, &
726 outer_scf_section, print_section
728 NULLIFY (outer_scf_section, hirshfeld_constraint_section, becke_constraint_section, &
729 print_section, group_section)
730 cdft_control => qs_control%cdft_control
731 cpassert(
ASSOCIATED(cdft_control))
736 i_val=qs_control%cdft_control%type)
740 l_val=cdft_control%reuse_precond)
742 i_val=cdft_control%precond_freq)
744 i_val=cdft_control%max_reuse)
746 l_val=cdft_control%purge_history)
748 i_val=cdft_control%purge_freq)
750 i_val=cdft_control%purge_offset)
752 i_val=cdft_control%ienergy)
758 IF (cdft_control%constraint_control%have_scf)
THEN
760 cpabort(
"Unsupported CDFT constraint.")
762 CALL read_constraint_definitions(cdft_control, cdft_control_section)
764 SELECT CASE (cdft_control%type)
768 IF (.NOT. exists) cpabort(
"BECKE_CONSTRAINT section is missing.")
770 NULLIFY (cdft_control%group(k)%gradients)
776 IF (.NOT. exists) cpabort(
"HIRSHFELD_CONSTRAINT section is missing.")
778 NULLIFY (cdft_control%group(k)%gradients_x)
779 NULLIFY (cdft_control%group(k)%gradients_y)
780 NULLIFY (cdft_control%group(k)%gradients_z)
782 CALL read_hirshfeld_constraint_section(cdft_control, hirshfeld_constraint_section)
784 cpabort(
"Unknown constraint type.")
790 qs_control%cdft = .false.
793 qs_control%cdft = .false.
803 SUBROUTINE read_hirshfeld_constraint_section(cdft_control, hirshfeld_section)
808 REAL(kind=
dp),
DIMENSION(:),
POINTER :: rtmplist
812 hirshfeld_control => cdft_control%hirshfeld_control
813 cpassert(
ASSOCIATED(hirshfeld_control))
815 CALL section_vals_val_get(hirshfeld_section,
"SHAPE_FUNCTION", i_val=hirshfeld_control%shape_function)
816 CALL section_vals_val_get(hirshfeld_section,
"GAUSSIAN_SHAPE", i_val=hirshfeld_control%gaussian_shape)
819 CALL section_vals_val_get(hirshfeld_section,
"USE_ATOMIC_CUTOFF", l_val=hirshfeld_control%use_atomic_cutoff)
820 CALL section_vals_val_get(hirshfeld_section,
"PRINT_DENSITY", l_val=hirshfeld_control%print_density)
822 CALL section_vals_val_get(hirshfeld_section,
"ATOMIC_CUTOFF", r_val=hirshfeld_control%atomic_cutoff)
824 IF (.NOT. hirshfeld_control%use_bohr)
THEN
825 hirshfeld_control%radius =
cp_unit_from_cp2k(hirshfeld_control%radius,
"angstrom")
829 hirshfeld_control%gaussian_shape ==
radius_user)
THEN
831 IF (.NOT. exists) cpabort(
"Keyword ATOMIC_RADII is missing.")
833 cpassert(
SIZE(rtmplist) > 0)
834 ALLOCATE (hirshfeld_control%radii(
SIZE(rtmplist)))
835 hirshfeld_control%radii(:) = rtmplist
840 shape_function_type=hirshfeld_control%shape_function, &
842 radius_type=hirshfeld_control%gaussian_shape, &
843 use_bohr=hirshfeld_control%use_bohr)
845 END SUBROUTINE read_hirshfeld_constraint_section
855 SUBROUTINE hfun_scale(fout, fun1, fun2, divide, small)
856 REAL(kind=
dp),
DIMENSION(:, :, :),
INTENT(OUT) :: fout
857 REAL(kind=
dp),
DIMENSION(:, :, :),
INTENT(IN) :: fun1, fun2
858 LOGICAL,
INTENT(IN) :: divide
859 REAL(kind=
dp),
INTENT(IN) :: small
861 INTEGER :: i1, i2, i3, n1, n2, n3
866 cpassert(n1 ==
SIZE(fun1, 1))
867 cpassert(n2 ==
SIZE(fun1, 2))
868 cpassert(n3 ==
SIZE(fun1, 3))
869 cpassert(n1 ==
SIZE(fun2, 1))
870 cpassert(n2 ==
SIZE(fun2, 2))
871 cpassert(n3 ==
SIZE(fun2, 3))
877 IF (fun2(i1, i2, i3) > small)
THEN
878 fout(i1, i2, i3) = fun1(i1, i2, i3)/fun2(i1, i2, i3)
880 fout(i1, i2, i3) = 0.0_dp
889 fout(i1, i2, i3) = fun1(i1, i2, i3)*fun2(i1, i2, i3)
895 END SUBROUTINE hfun_scale
905 SUBROUTINE hfun_zero(fun, th, just_bounds, bounds)
906 REAL(kind=
dp),
DIMENSION(:, :, :),
INTENT(INOUT) :: fun
907 REAL(kind=
dp),
INTENT(IN) :: th
908 LOGICAL :: just_bounds
909 INTEGER,
OPTIONAL :: bounds(2)
911 INTEGER :: i1, i2, i3, lb, n1, n2, n3, nzeroed, &
913 LOGICAL :: lb_final, ub_final
918 IF (just_bounds)
THEN
919 cpassert(
PRESENT(bounds))
926 IF (just_bounds) nzeroed = 0
928 IF (just_bounds) nzeroed_inner = 0
930 IF (fun(i1, i2, i3) < th)
THEN
931 IF (just_bounds)
THEN
932 nzeroed_inner = nzeroed_inner + 1
934 fun(i1, i2, i3) = 0.0_dp
937 IF (just_bounds)
EXIT
940 IF (just_bounds)
THEN
941 IF (nzeroed_inner < n1)
EXIT
942 nzeroed = nzeroed + nzeroed_inner
945 IF (just_bounds)
THEN
946 IF (nzeroed == (n2*n1))
THEN
947 IF (.NOT. lb_final)
THEN
949 ELSE IF (.NOT. ub_final)
THEN
954 IF (.NOT. lb_final) lb_final = .true.
955 IF (ub_final) ub_final = .false.
959 IF (just_bounds)
THEN
960 IF (.NOT. ub_final) ub = n3
963 bounds = bounds - (n3/2) - 1
966 END SUBROUTINE hfun_zero
976 CHARACTER(len=*),
PARAMETER :: routinen =
'hirshfeld_constraint_init'
978 CHARACTER(len=2) :: element_symbol
979 INTEGER :: handle, iat, iatom, igroup, ikind, ip, &
981 INTEGER,
DIMENSION(:),
POINTER :: atom_list
982 REAL(kind=
dp) :: zeff
983 REAL(kind=
dp),
DIMENSION(:),
POINTER :: radii_list
993 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
996 NULLIFY (cdft_control, hirshfeld_control, hirshfeld_env, qs_kind_set, atomic_kind_set, &
997 radii_list, dft_control, group, atomic_kind, atom_list)
998 CALL timeset(routinen, handle)
1004 CALL get_qs_env(qs_env, dft_control=dft_control)
1005 cdft_control => dft_control%qs_control%cdft_control
1006 hirshfeld_control => cdft_control%hirshfeld_control
1007 hirshfeld_env => hirshfeld_control%hirshfeld_env
1010 IF (.NOT.
ASSOCIATED(hirshfeld_env%kind_shape_fn))
THEN
1011 hirshfeld_env => hirshfeld_control%hirshfeld_env
1012 CALL get_qs_env(qs_env, atomic_kind_set=atomic_kind_set, qs_kind_set=qs_kind_set)
1013 cpassert(
ASSOCIATED(qs_kind_set))
1014 nkind =
SIZE(qs_kind_set)
1016 IF (
ASSOCIATED(hirshfeld_control%radii))
THEN
1017 IF (.NOT.
SIZE(atomic_kind_set) ==
SIZE(hirshfeld_control%radii)) &
1018 CALL cp_abort(__location__, &
1019 "Length of keyword HIRSHFELD_CONSTRAINT\ATOMIC_RADII does not "// &
1020 "match number of atomic kinds in the input coordinate file.")
1022 ALLOCATE (radii_list(
SIZE(hirshfeld_control%radii)))
1023 DO ikind = 1,
SIZE(hirshfeld_control%radii)
1024 IF (hirshfeld_control%use_bohr)
THEN
1025 radii_list(ikind) = hirshfeld_control%radii(ikind)
1027 radii_list(ikind) =
cp_unit_from_cp2k(hirshfeld_control%radii(ikind),
"angstrom")
1033 radius=hirshfeld_control%radius, &
1034 radii_list=radii_list)
1035 IF (
ASSOCIATED(radii_list))
DEALLOCATE (radii_list)
1039 IF (.NOT.
ASSOCIATED(hirshfeld_env%charges))
THEN
1040 CALL get_qs_env(qs_env, qs_kind_set=qs_kind_set, atomic_kind_set=atomic_kind_set, &
1041 nkind=nkind, natom=natom)
1042 ALLOCATE (hirshfeld_env%charges(natom))
1045 atomic_kind => atomic_kind_set(ikind)
1047 DO iat = 1,
SIZE(atom_list)
1048 iatom = atom_list(iat)
1049 hirshfeld_env%charges(iatom) = zeff
1055 IF (cdft_control%first_iteration)
THEN
1057 group => cdft_control%group
1058 CALL get_qs_env(qs_env, particle_set=particle_set)
1059 IF (
ASSOCIATED(hirshfeld_control%radii))
THEN
1060 WRITE (iw,
'(T3,A)') &
1061 'Atom Element Gaussian radius (angstrom)'
1063 CALL get_atomic_kind(atomic_kind=particle_set(iatom)%atomic_kind, element_symbol=element_symbol)
1064 WRITE (iw,
"(i7,T15,A2,T37,F8.3)") &
1065 iatom, adjustr(element_symbol),
cp_unit_from_cp2k(hirshfeld_control%radii(iatom),
"angstrom")
1067 WRITE (iw,
'(T3,A)') &
1068 '------------------------------------------------------------------------'
1070 WRITE (iw,
'(/,T3,A,T60)') &
1071 '----------------------- CDFT group definitions -------------------------'
1072 DO igroup = 1,
SIZE(group)
1073 IF (igroup > 1)
WRITE (iw,
'(T3,A)')
' '
1074 WRITE (iw,
'(T5,A,I5,A,I5)') &
1075 'Atomic group', igroup,
' of ',
SIZE(group)
1076 WRITE (iw,
'(T5,A)')
'Atom Element Coefficient'
1077 DO ip = 1,
SIZE(group(igroup)%atoms)
1078 iatom = group(igroup)%atoms(ip)
1079 CALL get_atomic_kind(atomic_kind=particle_set(iatom)%atomic_kind, element_symbol=element_symbol)
1080 WRITE (iw,
'(i8,T16,A2,T23,F8.3)') iatom, adjustr(element_symbol), group(igroup)%coeff(ip)
1083 WRITE (iw,
'(T3,A)') &
1084 '------------------------------------------------------------------------'
1086 cdft_control%first_iteration = .false.
1090 IF (
ASSOCIATED(hirshfeld_control%radii))
DEALLOCATE (hirshfeld_control%radii)
1091 CALL timestop(handle)
1104 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: electronic_charge
1106 CHARACTER(len=2) :: element_symbol
1107 INTEGER :: iatom, ikind, iw, jatom
1108 REAL(kind=
dp) :: tc(2), zeff
1113 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1116 NULLIFY (cdft_constraint_section, logger, particle_set, dft_control, qs_kind_set)
1120 particle_set=particle_set, &
1121 dft_control=dft_control, &
1122 qs_kind_set=qs_kind_set)
1123 cpassert(
ASSOCIATED(qs_kind_set))
1126 iw =
cp_print_key_unit_nr(logger, cdft_constraint_section,
"PROGRAM_RUN_INFO", extension=
".cdftLog")
1127 cdft_control => dft_control%qs_control%cdft_control
1133 IF (cdft_control%print_weight .AND. cdft_control%need_pot) &
1137 IF (iw > 0 .AND. cdft_control%atomic_charges)
THEN
1138 IF (.NOT. cdft_control%fragment_density)
THEN
1139 IF (dft_control%nspins == 1)
THEN
1140 WRITE (iw,
'(/,T3,A)') &
1141 '-------------------------------- CDFT atomic charges --------------------------------'
1142 WRITE (iw,
'(T3,A,A)') &
1143 '#Atom Element Is_constraint',
' Core charge Population (total)'// &
1146 DO iatom = 1, cdft_control%natoms
1147 jatom = cdft_control%atoms(iatom)
1149 element_symbol=element_symbol, &
1152 WRITE (iw,
"(i7,T15,A2,T23,L10,T39,F8.3,T61,F8.3,T81,F8.3)") &
1153 jatom, adjustr(element_symbol), cdft_control%is_constraint(iatom), zeff, electronic_charge(iatom, 1), &
1154 (zeff - electronic_charge(iatom, 1))
1155 tc(1) = tc(1) + (zeff - electronic_charge(iatom, 1))
1157 WRITE (iw,
'(/,T3,A,T81,F8.3,/)')
"Total Charge: ", tc(1)
1159 WRITE (iw,
'(/,T3,A)') &
1160 '------------------------------------------ CDFT atomic charges -------------------------------------------'
1161 WRITE (iw,
'(T3,A,A)') &
1162 '#Atom Element Is_constraint',
' Core charge Population (alpha, beta)'// &
1163 ' Net charge Spin population'
1165 DO iatom = 1, cdft_control%natoms
1166 jatom = cdft_control%atoms(iatom)
1168 element_symbol=element_symbol, &
1171 WRITE (iw,
"(i7,T15,A2,T23,L10,T39,F8.3,T53,F8.3,T67,F8.3,T81,F8.3,T102,F8.3)") &
1172 jatom, adjustr(element_symbol), &
1173 cdft_control%is_constraint(iatom), &
1174 zeff, electronic_charge(iatom, 1), electronic_charge(iatom, 2), &
1175 (zeff - electronic_charge(iatom, 1) - electronic_charge(iatom, 2)), &
1176 electronic_charge(iatom, 1) - electronic_charge(iatom, 2)
1177 tc(1) = tc(1) + (zeff - electronic_charge(iatom, 1) - electronic_charge(iatom, 2))
1178 tc(2) = tc(2) + (electronic_charge(iatom, 1) - electronic_charge(iatom, 2))
1180 WRITE (iw,
'(/,T3,A,T81,F8.3,T102,F8.3/)')
"Total Charge and Spin Moment: ", tc(1), tc(2)
1184 WRITE (iw,
'(/,T3,A)') &
1185 '-------------------------------- CDFT atomic charges --------------------------------'
1186 IF (dft_control%nspins == 1)
THEN
1187 WRITE (iw,
'(T3,A,A)') &
1188 '#Atom Element Is_constraint',
' Fragment charge Population (total)'// &
1191 WRITE (iw,
'(T3,A,A)') &
1192 '#Atom Element Is_constraint',
' Fragment charge Population (alpha, beta)'// &
1196 DO iatom = 1, cdft_control%natoms
1197 jatom = cdft_control%atoms(iatom)
1199 element_symbol=element_symbol, &
1201 IF (dft_control%nspins == 1)
THEN
1202 WRITE (iw,
"(i7,T15,A2,T23,L10,T43,F8.3,T65,F8.3,T81,F8.3)") &
1203 jatom, adjustr(element_symbol), &
1204 cdft_control%is_constraint(iatom), &
1205 cdft_control%charges_fragment(iatom, 1), &
1206 electronic_charge(iatom, 1), &
1207 (electronic_charge(iatom, 1) - &
1208 cdft_control%charges_fragment(iatom, 1))
1209 tc(1) = tc(1) + (electronic_charge(iatom, 1) - &
1210 cdft_control%charges_fragment(iatom, 1))
1212 WRITE (iw,
"(i7,T15,A2,T23,L10,T43,F8.3,T57,F8.3,T69,F8.3,T81,F8.3)") &
1213 jatom, adjustr(element_symbol), &
1214 cdft_control%is_constraint(iatom), &
1215 cdft_control%charges_fragment(iatom, 1), &
1216 electronic_charge(iatom, 1), electronic_charge(iatom, 2), &
1217 (electronic_charge(iatom, 1) + electronic_charge(iatom, 2) - &
1218 cdft_control%charges_fragment(iatom, 1))
1219 tc(1) = tc(1) + (electronic_charge(iatom, 1) + electronic_charge(iatom, 2) - &
1220 cdft_control%charges_fragment(iatom, 1))
1223 WRITE (iw,
'(/,T3,A,T81,F8.3,/)')
"Total Charge: ", tc(1)
1225 WRITE (iw,
'(/,T3,A)') &
1226 '------------------------------------------ CDFT atomic charges -------------------------------------------'
1227 WRITE (iw,
'(T3,A,A)') &
1228 '#Atom Element Is_constraint',
' Fragment charge/spin moment'// &
1229 ' Population (alpha, beta) Net charge/spin moment'
1231 DO iatom = 1, cdft_control%natoms
1232 jatom = cdft_control%atoms(iatom)
1234 element_symbol=element_symbol, &
1236 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)") &
1237 jatom, adjustr(element_symbol), &
1238 cdft_control%is_constraint(iatom), &
1239 cdft_control%charges_fragment(iatom, 1), &
1240 cdft_control%charges_fragment(iatom, 2), &
1241 electronic_charge(iatom, 1), electronic_charge(iatom, 2), &
1242 (electronic_charge(iatom, 1) + electronic_charge(iatom, 2) - &
1243 cdft_control%charges_fragment(iatom, 1)), &
1244 (electronic_charge(iatom, 1) - electronic_charge(iatom, 2) - &
1245 cdft_control%charges_fragment(iatom, 2))
1246 tc(1) = tc(1) + (electronic_charge(iatom, 1) + electronic_charge(iatom, 2) - &
1247 cdft_control%charges_fragment(iatom, 1))
1248 tc(2) = tc(2) + (electronic_charge(iatom, 1) - electronic_charge(iatom, 2) - &
1249 cdft_control%charges_fragment(iatom, 2))
1251 WRITE (iw,
'(/,T3,A,T90,F8.3,T102,F8.3/)')
"Total Charge and Spin Moment: ", tc(1), tc(2)
1265 CHARACTER(LEN=default_path_length) :: middle_name
1266 INTEGER :: igroup, unit_nr
1276 NULLIFY (cdft_constraint_section, logger, particles, dft_control, &
1277 para_env, subsys, cdft_control)
1280 CALL get_qs_env(qs_env, subsys=subsys, para_env=para_env, dft_control=dft_control)
1282 cdft_control => dft_control%qs_control%cdft_control
1285 DO igroup = 1,
SIZE(cdft_control%group)
1287 middle_name =
"cdft_weight_"//trim(adjustl(
cp_to_string(igroup)))
1289 middle_name=middle_name, &
1290 extension=
".cube", file_position=
"REWIND", &
1291 log_filename=.false., mpi_io=mpi_io)
1293 IF (para_env%is_source() .AND. unit_nr .LT. 1) &
1294 CALL cp_abort(__location__, &
1295 "Please turn on PROGRAM_RUN_INFO to print CDFT weight function.")
1299 "CDFT Weight Function", &
1300 particles=particles, &
1301 stride=
section_get_ivals(cdft_constraint_section,
"PROGRAM_RUN_INFO%WEIGHT_FUNCTION%STRIDE"), &
1315 CHARACTER(LEN=default_path_length) :: middle_name
1316 INTEGER :: iatom, igroup, unit_nr
1327 NULLIFY (cdft_constraint_section, logger, particles, dft_control, &
1328 para_env, subsys, cdft_control, pw_env)
1331 CALL get_qs_env(qs_env, subsys=subsys, para_env=para_env, dft_control=dft_control, pw_env=pw_env)
1333 cdft_control => dft_control%qs_control%cdft_control
1338 DO igroup = 1,
SIZE(cdft_control%group)
1340 middle_name =
"hw_rho_total"//trim(adjustl(
cp_to_string(igroup)))
1341 unit_nr =
cp_print_key_unit_nr(logger, cdft_constraint_section,
"PROGRAM_RUN_INFO", mpi_io=mpi_io, &
1342 file_position=
"REWIND", middle_name=middle_name, extension=
".cube")
1344 CALL cp_pw_to_cube(cdft_control%hw_rho_total, unit_nr,
"CDFT Weight Function", mpi_io=mpi_io, &
1345 particles=particles, stride=
section_get_ivals(cdft_constraint_section,
"PROGRAM_RUN_INFO%WEIGHT_FUNCTION%STRIDE"))
1351 DO igroup = 1,
SIZE(cdft_control%group)
1353 middle_name =
"hw_rho_total_constraint_"//trim(adjustl(
cp_to_string(igroup)))
1354 unit_nr =
cp_print_key_unit_nr(logger, cdft_constraint_section,
"PROGRAM_RUN_INFO", mpi_io=mpi_io, &
1355 file_position=
"REWIND", middle_name=middle_name, extension=
".cube")
1357 CALL cp_pw_to_cube(cdft_control%group(igroup)%hw_rho_total_constraint, unit_nr, &
1358 "CDFT Weight Function", mpi_io=mpi_io, particles=particles, &
1359 stride=
section_get_ivals(cdft_constraint_section,
"PROGRAM_RUN_INFO%WEIGHT_FUNCTION%STRIDE"))
1365 DO igroup = 1,
SIZE(cdft_control%group)
1366 DO iatom = 1, (cdft_control%natoms)
1368 middle_name =
"hw_rho_atomic_"//trim(adjustl(
cp_to_string(iatom)))
1369 unit_nr =
cp_print_key_unit_nr(logger, cdft_constraint_section,
"PROGRAM_RUN_INFO", mpi_io=mpi_io, &
1370 file_position=
"REWIND", middle_name=middle_name, extension=
".cube")
1372 CALL cp_pw_to_cube(cdft_control%group(igroup)%hw_rho_atomic(iatom), unit_nr, &
1373 "CDFT Weight Function", mpi_io=mpi_io, particles=particles, &
1374 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, stride, 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, 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, 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, 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, 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, ecoul_1c, rho0_s_rs, rho0_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)
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, 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.
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.