123#include "./base/base_uses.f90"
131 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_kind_types'
139 INTEGER :: max_scf = -1
140 INTEGER :: lr_atom = -1
141 REAL(KIND=
dp) :: eps_u_ramping = 0.0_dp
142 REAL(KIND=
dp) :: eps_scf = huge(0.0_dp)
143 REAL(KIND=
dp) :: u_minus_j_target = 0.0_dp
144 REAL(KIND=
dp) :: u_minus_j = 0.0_dp
145 REAL(KIND=
dp) :: hund_j = 0.0_dp
146 REAL(KIND=
dp) :: u_ramping = 0.0_dp
147 REAL(KIND=
dp) :: u = 0.0_dp
148 REAL(KIND=
dp) :: j = 0.0_dp
149 REAL(KIND=
dp) :: alpha = 0.0_dp
150 REAL(KIND=
dp) :: beta = 0.0_dp
151 REAL(KIND=
dp) :: j0 = 0.0_dp
152 REAL(KIND=
dp) :: occupation = -1.0_dp
153 REAL(KIND=
dp) :: proj_shell_charge(4) = 0.0_dp
154 REAL(KIND=
dp),
DIMENSION(:), &
155 ALLOCATABLE :: perturbation_strength
156 REAL(KIND=
dp),
DIMENSION(:),
POINTER :: ao_coef => null()
157 INTEGER,
DIMENSION(:),
POINTER :: orbitals => null()
158 LOGICAL :: init_u_ramping_each_scf = .false.
159 LOGICAL :: smear = .false.
160 LOGICAL :: do_mtlr = .false.
161 LOGICAL :: u_j_loop = .false.
162 REAL(KIND=
dp),
DIMENSION(:),
POINTER :: nelec => null()
163 END TYPE dft_plus_u_type
170 REAL(kind=
dp) :: beta = 0.0_dp
171 REAL(kind=
dp) :: weight = 0.0_dp
172 INTEGER :: max_projector = -1
173 REAL(kind=
dp) :: beta_radius = huge(
dp)
180 REAL(kind=
dp) :: beta = 0.0_dp
181 REAL(kind=
dp) :: beta_radius = huge(
dp)
182 REAL(kind=
dp) :: weight = 0.0_dp
183 REAL(kind=
dp) :: screening = 0.0_dp
184 REAL(kind=
dp) :: screening_radius = huge(
dp)
191 CHARACTER(LEN=default_string_length) :: name =
""
192 CHARACTER(LEN=2) :: element_symbol =
""
193 INTEGER :: natom = -1
208 REAL(kind=
dp) :: covalent_radius = 0.0_dp
209 REAL(kind=
dp) :: vdw_radius = 0.0_dp
212 REAL(kind=
dp) :: hard_radius = 0.8_dp*
bohr
213 REAL(kind=
dp) :: hard0_radius = 0.8_dp*
bohr
214 REAL(kind=
dp) :: max_rad_local = 13.2_dp*
bohr
215 LOGICAL :: paw_atom = .false.
216 LOGICAL :: gpw_type_forced = .false.
218 LOGICAL :: ghost = .false.
219 LOGICAL :: monovalent = .false.
220 LOGICAL :: floating = .false.
221 INTEGER :: lmax_dftb = -1
222 REAL(kind=
dp) :: dudq_dftb3 = 0.0_dp
223 REAL(kind=
dp) :: magnetization = 0.0_dp
224 INTEGER,
DIMENSION(:, :),
POINTER :: addel => null()
225 INTEGER,
DIMENSION(:, :),
POINTER :: laddel => null()
226 INTEGER,
DIMENSION(:, :),
POINTER :: naddel => null()
229 INTEGER :: ngrid_rad = 50
230 INTEGER :: ngrid_ang = 50
231 INTEGER :: lmax_rho0 = 0
233 INTEGER,
DIMENSION(:),
POINTER :: elec_conf => null()
234 LOGICAL :: bs_occupation = .false.
236 LOGICAL :: no_optimize = .true.
238 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: nlcc_pot => null()
241 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: reltmat => null()
242 INTEGER :: pao_basis_size = -1
243 CHARACTER(LEN=default_path_length) :: pao_model_file =
""
253 POINTER :: qs_kind_set => null()
254 END TYPE qs_kind_p_type
287 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
289 INTEGER :: ikind, nkind
291 IF (
ASSOCIATED(qs_kind_set))
THEN
293 nkind =
SIZE(qs_kind_set)
296 IF (
ASSOCIATED(qs_kind_set(ikind)%all_potential))
THEN
299 IF (
ASSOCIATED(qs_kind_set(ikind)%tnadd_potential))
THEN
302 IF (
ASSOCIATED(qs_kind_set(ikind)%gth_potential))
THEN
305 IF (
ASSOCIATED(qs_kind_set(ikind)%sgp_potential))
THEN
308 IF (
ASSOCIATED(qs_kind_set(ikind)%upf_potential))
THEN
310 DEALLOCATE (qs_kind_set(ikind)%upf_potential)
312 IF (
ASSOCIATED(qs_kind_set(ikind)%cneo_potential))
THEN
315 IF (
ASSOCIATED(qs_kind_set(ikind)%se_parameter))
THEN
318 IF (
ASSOCIATED(qs_kind_set(ikind)%dftb_parameter))
THEN
321 IF (
ASSOCIATED(qs_kind_set(ikind)%xtb_parameter))
THEN
324 IF (
ASSOCIATED(qs_kind_set(ikind)%paw_proj_set))
THEN
327 IF (
ASSOCIATED(qs_kind_set(ikind)%harmonics))
THEN
330 IF (
ASSOCIATED(qs_kind_set(ikind)%grid_atom))
THEN
333 IF (
ASSOCIATED(qs_kind_set(ikind)%elec_conf))
THEN
334 DEALLOCATE (qs_kind_set(ikind)%elec_conf)
337 IF (
ASSOCIATED(qs_kind_set(ikind)%dft_plus_u))
THEN
338 IF (
ASSOCIATED(qs_kind_set(ikind)%dft_plus_u%orbitals))
THEN
339 DEALLOCATE (qs_kind_set(ikind)%dft_plus_u%orbitals)
341 IF (
ASSOCIATED(qs_kind_set(ikind)%dft_plus_u%nelec))
THEN
342 DEALLOCATE (qs_kind_set(ikind)%dft_plus_u%nelec)
344 IF (
ASSOCIATED(qs_kind_set(ikind)%dft_plus_u%ao_coef))
THEN
345 DEALLOCATE (qs_kind_set(ikind)%dft_plus_u%ao_coef)
347 DEALLOCATE (qs_kind_set(ikind)%dft_plus_u)
350 IF (
ASSOCIATED(qs_kind_set(ikind)%nlcc_pot))
THEN
351 DEALLOCATE (qs_kind_set(ikind)%nlcc_pot)
354 IF (
ASSOCIATED(qs_kind_set(ikind)%dispersion))
THEN
355 DEALLOCATE (qs_kind_set(ikind)%dispersion)
357 IF (
ASSOCIATED(qs_kind_set(ikind)%addel))
THEN
358 DEALLOCATE (qs_kind_set(ikind)%addel)
360 IF (
ASSOCIATED(qs_kind_set(ikind)%naddel))
THEN
361 DEALLOCATE (qs_kind_set(ikind)%naddel)
363 IF (
ASSOCIATED(qs_kind_set(ikind)%laddel))
THEN
364 DEALLOCATE (qs_kind_set(ikind)%laddel)
366 IF (
ASSOCIATED(qs_kind_set(ikind)%reltmat))
THEN
367 DEALLOCATE (qs_kind_set(ikind)%reltmat)
370 IF (
ASSOCIATED(qs_kind_set(ikind)%pao_potentials))
THEN
371 DEALLOCATE (qs_kind_set(ikind)%pao_potentials)
373 IF (
ASSOCIATED(qs_kind_set(ikind)%pao_descriptors))
THEN
374 DEALLOCATE (qs_kind_set(ikind)%pao_descriptors)
380 DEALLOCATE (qs_kind_set)
382 CALL cp_abort(__location__, &
383 "The pointer qs_kind_set is not associated and "// &
384 "cannot be deallocated")
474 basis_set, basis_type, ncgf, nsgf, &
475 all_potential, tnadd_potential, gth_potential, sgp_potential, upf_potential, &
476 cneo_potential, se_parameter, dftb_parameter, xtb_parameter, &
477 dftb3_param, zatom, zeff, elec_conf, mao, lmax_dftb, &
478 alpha_core_charge, ccore_charge, core_charge, core_charge_radius, &
479 paw_proj_set, paw_atom, hard_radius, hard0_radius, max_rad_local, &
480 covalent_radius, vdw_radius, &
481 gpw_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, &
482 ngrid_ang, ngrid_rad, lmax_rho0, &
483 dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, &
484 u_minus_j, hund_j, U_of_dft_plus_u, J_of_dft_plus_u, &
485 alpha_of_dft_plus_u, beta_of_dft_plus_u, J0_of_dft_plus_u, occupation_of_dft_plus_u, dispersion, &
486 bs_occupation, magnetization, no_optimize, addel, laddel, naddel, orbitals, &
487 max_scf, eps_scf, smear, u_ramping, u_minus_j_target, eps_u_ramping, proj_shell_charge, &
488 lr_atom, do_mtlr, u_j_loop, ao_coef, &
489 init_u_ramping_each_scf, reltmat, ghost, monovalent, floating, name, element_symbol, &
490 pao_basis_size, pao_model_file, pao_potentials, pao_descriptors, nelec)
494 CHARACTER(len=*),
OPTIONAL :: basis_type
495 INTEGER,
INTENT(OUT),
OPTIONAL :: ncgf, nsgf
505 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: dftb3_param
506 INTEGER,
INTENT(OUT),
OPTIONAL :: zatom
507 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: zeff
508 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: elec_conf
509 INTEGER,
INTENT(OUT),
OPTIONAL :: mao, lmax_dftb
510 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: alpha_core_charge, ccore_charge, &
511 core_charge, core_charge_radius
513 LOGICAL,
INTENT(OUT),
OPTIONAL :: paw_atom
514 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: hard_radius, hard0_radius, &
515 max_rad_local, covalent_radius, &
517 LOGICAL,
INTENT(OUT),
OPTIONAL :: gpw_type_forced
519 INTEGER,
INTENT(OUT),
OPTIONAL :: max_iso_not0, max_s_harm
521 INTEGER,
INTENT(OUT),
OPTIONAL :: ngrid_ang, ngrid_rad, lmax_rho0
522 LOGICAL,
INTENT(OUT),
OPTIONAL :: dft_plus_u_atom
523 INTEGER,
INTENT(OUT),
OPTIONAL :: l_of_dft_plus_u, n_of_dft_plus_u
524 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: u_minus_j, hund_j, u_of_dft_plus_u, j_of_dft_plus_u, &
525 alpha_of_dft_plus_u, beta_of_dft_plus_u, j0_of_dft_plus_u, occupation_of_dft_plus_u
527 LOGICAL,
INTENT(OUT),
OPTIONAL :: bs_occupation
528 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: magnetization
529 LOGICAL,
INTENT(OUT),
OPTIONAL :: no_optimize
530 INTEGER,
DIMENSION(:, :),
OPTIONAL,
POINTER :: addel, laddel, naddel
531 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: orbitals
532 INTEGER,
OPTIONAL :: max_scf
533 REAL(kind=
dp),
OPTIONAL :: eps_scf
534 LOGICAL,
OPTIONAL :: smear
535 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: u_ramping, u_minus_j_target, &
536 eps_u_ramping, proj_shell_charge(4)
537 INTEGER,
OPTIONAL :: lr_atom
538 LOGICAL,
INTENT(OUT),
OPTIONAL :: do_mtlr, u_j_loop
539 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: ao_coef
540 LOGICAL,
OPTIONAL :: init_u_ramping_each_scf
541 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: reltmat
542 LOGICAL,
OPTIONAL :: ghost
543 LOGICAL,
INTENT(OUT),
OPTIONAL :: monovalent
544 LOGICAL,
OPTIONAL :: floating
545 CHARACTER(LEN=default_string_length), &
546 INTENT(OUT),
OPTIONAL :: name
547 CHARACTER(LEN=2),
INTENT(OUT),
OPTIONAL :: element_symbol
548 INTEGER,
INTENT(OUT),
OPTIONAL :: pao_basis_size
549 CHARACTER(LEN=default_path_length),
INTENT(OUT), &
550 OPTIONAL :: pao_model_file
554 OPTIONAL,
POINTER :: pao_descriptors
555 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: nelec
557 CHARACTER(LEN=default_string_length) :: my_basis_type
563 IF (
PRESENT(basis_type))
THEN
564 my_basis_type = basis_type
566 my_basis_type =
"ORB"
569 IF (
PRESENT(basis_set))
THEN
571 basis_type=my_basis_type)
574 IF (
PRESENT(ncgf))
THEN
576 basis_type=my_basis_type)
577 IF (
ASSOCIATED(tmp_basis_set))
THEN
579 ELSE IF (
ASSOCIATED(qs_kind%dftb_parameter))
THEN
580 l = qs_kind%dftb_parameter%lmax
581 ncgf = ((l + 1)*(l + 2)*(l + 3))/6
587 IF (
PRESENT(nsgf))
THEN
589 basis_type=my_basis_type)
590 IF (
ASSOCIATED(tmp_basis_set))
THEN
592 ELSE IF (
ASSOCIATED(qs_kind%dftb_parameter))
THEN
593 nsgf = qs_kind%dftb_parameter%natorb
599 IF (
PRESENT(all_potential)) all_potential => qs_kind%all_potential
600 IF (
PRESENT(tnadd_potential)) tnadd_potential => qs_kind%tnadd_potential
601 IF (
PRESENT(gth_potential)) gth_potential => qs_kind%gth_potential
602 IF (
PRESENT(sgp_potential)) sgp_potential => qs_kind%sgp_potential
603 IF (
PRESENT(upf_potential)) upf_potential => qs_kind%upf_potential
604 IF (
PRESENT(cneo_potential)) cneo_potential => qs_kind%cneo_potential
605 IF (
PRESENT(se_parameter)) se_parameter => qs_kind%se_parameter
606 IF (
PRESENT(dftb_parameter)) dftb_parameter => qs_kind%dftb_parameter
607 IF (
PRESENT(xtb_parameter)) xtb_parameter => qs_kind%xtb_parameter
608 IF (
PRESENT(element_symbol)) element_symbol = qs_kind%element_symbol
609 IF (
PRESENT(name)) name = qs_kind%name
610 IF (
PRESENT(dftb3_param)) dftb3_param = qs_kind%dudq_dftb3
611 IF (
PRESENT(elec_conf)) elec_conf => qs_kind%elec_conf
612 IF (
PRESENT(alpha_core_charge))
THEN
613 IF (
ASSOCIATED(qs_kind%all_potential))
THEN
615 alpha_core_charge=alpha_core_charge)
616 ELSE IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
618 alpha_core_charge=alpha_core_charge)
619 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
621 alpha_core_charge=alpha_core_charge)
622 ELSE IF (
ASSOCIATED(qs_kind%cneo_potential))
THEN
623 cpabort(
"CNEO ALPHA CORE CHARGE NOT AVAILABLE")
625 alpha_core_charge = 1.0_dp
628 IF (
PRESENT(ccore_charge))
THEN
629 IF (
ASSOCIATED(qs_kind%all_potential))
THEN
631 ccore_charge=ccore_charge)
632 ELSE IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
634 ccore_charge=ccore_charge)
635 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
637 ccore_charge=ccore_charge)
638 ELSE IF (
ASSOCIATED(qs_kind%upf_potential))
THEN
639 cpabort(
"UPF CCORE CHARGE NOT AVAILABLE")
640 ELSE IF (
ASSOCIATED(qs_kind%cneo_potential))
THEN
641 cpabort(
"CNEO CCORE CHARGE NOT AVAILABLE")
643 ccore_charge = 0.0_dp
646 IF (
PRESENT(core_charge_radius))
THEN
647 IF (
ASSOCIATED(qs_kind%all_potential))
THEN
649 core_charge_radius=core_charge_radius)
650 ELSE IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
652 core_charge_radius=core_charge_radius)
653 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
655 core_charge_radius=core_charge_radius)
656 ELSE IF (
ASSOCIATED(qs_kind%upf_potential))
THEN
657 cpabort(
"UPF CORE CHARGE RADIUS NOT AVAILABLE")
658 ELSE IF (
ASSOCIATED(qs_kind%cneo_potential))
THEN
659 cpabort(
"CNEO CORE CHARGE RADIUS NOT AVAILABLE")
661 core_charge_radius = 0.0_dp
664 IF (
PRESENT(core_charge))
THEN
665 IF (
ASSOCIATED(qs_kind%all_potential))
THEN
668 ELSE IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
671 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
674 ELSE IF (
ASSOCIATED(qs_kind%upf_potential))
THEN
675 cpabort(
"UPF CORE CHARGE NOT AVAILABLE")
676 ELSE IF (
ASSOCIATED(qs_kind%cneo_potential))
THEN
684 IF (
PRESENT(zatom))
THEN
686 CALL get_ptable_info(qs_kind%element_symbol, ielement=zatom, found=found)
690 IF (
PRESENT(zeff))
THEN
691 IF (
ASSOCIATED(qs_kind%all_potential))
THEN
692 CALL get_potential(potential=qs_kind%all_potential, zeff=zeff)
693 ELSE IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
694 CALL get_potential(potential=qs_kind%gth_potential, zeff=zeff)
695 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
696 CALL get_potential(potential=qs_kind%sgp_potential, zeff=zeff)
697 ELSE IF (
ASSOCIATED(qs_kind%upf_potential))
THEN
698 zeff = qs_kind%upf_potential%zion
699 ELSE IF (
ASSOCIATED(qs_kind%cneo_potential))
THEN
706 IF (
PRESENT(covalent_radius)) covalent_radius = qs_kind%covalent_radius
707 IF (
PRESENT(vdw_radius)) vdw_radius = qs_kind%vdw_radius
709 IF (
PRESENT(paw_proj_set)) paw_proj_set => qs_kind%paw_proj_set
710 IF (
PRESENT(paw_atom)) paw_atom = qs_kind%paw_atom
711 IF (
PRESENT(gpw_type_forced)) gpw_type_forced = qs_kind%gpw_type_forced
712 IF (
PRESENT(hard_radius)) hard_radius = qs_kind%hard_radius
713 IF (
PRESENT(hard0_radius)) hard0_radius = qs_kind%hard0_radius
714 IF (
PRESENT(max_rad_local)) max_rad_local = qs_kind%max_rad_local
715 IF (
PRESENT(harmonics)) harmonics => qs_kind%harmonics
716 IF (
PRESENT(max_s_harm))
THEN
717 IF (
ASSOCIATED(qs_kind%harmonics))
THEN
718 max_s_harm = qs_kind%harmonics%max_s_harm
723 IF (
PRESENT(max_iso_not0))
THEN
724 IF (
ASSOCIATED(qs_kind%harmonics))
THEN
725 max_iso_not0 = qs_kind%harmonics%max_iso_not0
730 IF (
PRESENT(grid_atom)) grid_atom => qs_kind%grid_atom
731 IF (
PRESENT(ngrid_ang)) ngrid_ang = qs_kind%ngrid_ang
732 IF (
PRESENT(ngrid_rad)) ngrid_rad = qs_kind%ngrid_rad
733 IF (
PRESENT(lmax_rho0)) lmax_rho0 = qs_kind%lmax_rho0
734 IF (
PRESENT(ghost)) ghost = qs_kind%ghost
735 IF (
PRESENT(monovalent)) monovalent = qs_kind%monovalent
736 IF (
PRESENT(floating)) floating = qs_kind%floating
737 IF (
PRESENT(dft_plus_u_atom)) dft_plus_u_atom =
ASSOCIATED(qs_kind%dft_plus_u)
738 IF (
PRESENT(do_mtlr))
THEN
739 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
740 do_mtlr = qs_kind%dft_plus_u%do_mtlr
745 IF (
PRESENT(l_of_dft_plus_u))
THEN
746 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
747 l_of_dft_plus_u = qs_kind%dft_plus_u%l
752 IF (
PRESENT(n_of_dft_plus_u))
THEN
753 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
754 n_of_dft_plus_u = qs_kind%dft_plus_u%n
759 IF (
PRESENT(u_minus_j))
THEN
760 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
761 u_minus_j = qs_kind%dft_plus_u%u_minus_j
766 IF (
PRESENT(u_minus_j_target))
THEN
767 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
768 u_minus_j_target = qs_kind%dft_plus_u%u_minus_j_target
770 u_minus_j_target = 0.0_dp
773 IF (
PRESENT(hund_j))
THEN
774 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
775 hund_j = qs_kind%dft_plus_u%hund_j
780 IF (
PRESENT(u_of_dft_plus_u))
THEN
781 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
782 u_of_dft_plus_u = qs_kind%dft_plus_u%U
784 u_of_dft_plus_u = 0.0_dp
787 IF (
PRESENT(j_of_dft_plus_u))
THEN
788 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
789 j_of_dft_plus_u = qs_kind%dft_plus_u%J
791 j_of_dft_plus_u = 0.0_dp
794 IF (
PRESENT(alpha_of_dft_plus_u))
THEN
795 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
796 alpha_of_dft_plus_u = qs_kind%dft_plus_u%alpha
798 alpha_of_dft_plus_u = 0.0_dp
801 IF (
PRESENT(beta_of_dft_plus_u))
THEN
802 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
803 beta_of_dft_plus_u = qs_kind%dft_plus_u%beta
805 beta_of_dft_plus_u = 0.0_dp
808 IF (
PRESENT(j0_of_dft_plus_u))
THEN
809 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
810 j0_of_dft_plus_u = qs_kind%dft_plus_u%J0
812 j0_of_dft_plus_u = 0.0_dp
815 IF (
PRESENT(occupation_of_dft_plus_u))
THEN
816 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
817 occupation_of_dft_plus_u = qs_kind%dft_plus_u%occupation
819 occupation_of_dft_plus_u = -1.0_dp
823 IF (
PRESENT(init_u_ramping_each_scf))
THEN
824 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
825 init_u_ramping_each_scf = qs_kind%dft_plus_u%init_u_ramping_each_scf
827 init_u_ramping_each_scf = .false.
830 IF (
PRESENT(u_ramping))
THEN
831 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
832 u_ramping = qs_kind%dft_plus_u%u_ramping
837 IF (
PRESENT(eps_u_ramping))
THEN
838 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
839 eps_u_ramping = qs_kind%dft_plus_u%eps_u_ramping
841 eps_u_ramping = 1.0e-5_dp
844 IF (
PRESENT(lr_atom))
THEN
845 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
846 lr_atom = qs_kind%dft_plus_u%lr_atom
851 IF (
PRESENT(u_j_loop))
THEN
852 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
853 u_j_loop = qs_kind%dft_plus_u%u_j_loop
858 IF (
PRESENT(proj_shell_charge))
THEN
859 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
860 proj_shell_charge = qs_kind%dft_plus_u%proj_shell_charge
862 proj_shell_charge = 0.0_dp
865 IF (
PRESENT(nelec))
THEN
867 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
868 IF (
ASSOCIATED(qs_kind%dft_plus_u%nelec))
THEN
869 nelec => qs_kind%dft_plus_u%nelec
873 IF (
PRESENT(orbitals))
THEN
875 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
876 IF (
ASSOCIATED(qs_kind%dft_plus_u%orbitals))
THEN
877 orbitals => qs_kind%dft_plus_u%orbitals
881 IF (
PRESENT(eps_scf))
THEN
882 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
883 eps_scf = qs_kind%dft_plus_u%eps_scf
888 IF (
PRESENT(max_scf))
THEN
889 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
890 max_scf = qs_kind%dft_plus_u%max_scf
895 IF (
PRESENT(smear))
THEN
896 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
897 smear = qs_kind%dft_plus_u%smear
902 IF (
PRESENT(dispersion)) dispersion => qs_kind%dispersion
903 IF (
PRESENT(bs_occupation)) bs_occupation = qs_kind%bs_occupation
904 IF (
PRESENT(addel)) addel => qs_kind%addel
905 IF (
PRESENT(laddel)) laddel => qs_kind%laddel
906 IF (
PRESENT(naddel)) naddel => qs_kind%naddel
908 IF (
PRESENT(magnetization)) magnetization = qs_kind%magnetization
910 IF (
PRESENT(no_optimize)) no_optimize = qs_kind%no_optimize
912 IF (
PRESENT(reltmat)) reltmat => qs_kind%reltmat
914 IF (
PRESENT(ao_coef))
THEN
916 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
917 IF (
ASSOCIATED(qs_kind%dft_plus_u%ao_coef))
THEN
918 ao_coef => qs_kind%dft_plus_u%ao_coef
923 IF (
PRESENT(mao)) mao = qs_kind%mao
925 IF (
PRESENT(lmax_dftb)) lmax_dftb = qs_kind%lmax_dftb
927 IF (
PRESENT(pao_basis_size)) pao_basis_size = qs_kind%pao_basis_size
928 IF (
PRESENT(pao_model_file)) pao_model_file = qs_kind%pao_model_file
930 IF (
PRESENT(pao_descriptors)) pao_descriptors => qs_kind%pao_descriptors
976 all_potential_present, tnadd_potential_present, gth_potential_present, &
977 sgp_potential_present, paw_atom_present, dft_plus_u_atom_present, &
978 maxcgf, maxsgf, maxco, maxco_proj, maxgtops, maxlgto, maxlprj, maxnset, maxsgf_set, &
979 ncgf, npgf, nset, nsgf, nshell, maxpol, maxlppl, maxlppnl, maxppnl, &
980 nelectron, maxder, max_ngrid_rad, max_sph_harm, maxg_iso_not0, lmax_rho0, &
981 basis_rcut, do_mtlr_present, &
982 basis_type, total_zeff_corr, npgf_seg, &
983 cneo_potential_present, nkind_q, natom_q)
985 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
986 LOGICAL,
INTENT(OUT),
OPTIONAL :: all_potential_present, tnadd_potential_present, &
987 gth_potential_present, sgp_potential_present, paw_atom_present, dft_plus_u_atom_present
988 INTEGER,
INTENT(OUT),
OPTIONAL :: maxcgf, maxsgf, maxco, maxco_proj, maxgtops, maxlgto, &
989 maxlprj, maxnset, maxsgf_set, ncgf, npgf, nset, nsgf, nshell, maxpol, maxlppl, maxlppnl, &
991 INTEGER,
INTENT(IN),
OPTIONAL :: maxder
992 INTEGER,
INTENT(OUT),
OPTIONAL :: max_ngrid_rad, max_sph_harm, &
993 maxg_iso_not0, lmax_rho0
994 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: basis_rcut
995 LOGICAL,
INTENT(OUT),
OPTIONAL :: do_mtlr_present
996 CHARACTER(len=*),
OPTIONAL :: basis_type
997 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: total_zeff_corr
998 INTEGER,
INTENT(OUT),
OPTIONAL :: npgf_seg
999 LOGICAL,
INTENT(OUT),
OPTIONAL :: cneo_potential_present
1000 INTEGER,
INTENT(OUT),
OPTIONAL :: nkind_q, natom_q
1002 CHARACTER(len=default_string_length) :: my_basis_type
1003 INTEGER :: ikind,
imax, lmax_rho0_kind, &
1004 max_iso_not0, max_s_harm, n, &
1005 ngrid_rad, nkind, nrloc(10), &
1007 LOGICAL :: dft_plus_u_atom, do_mtlr, &
1008 ecp_semi_local, paw_atom
1009 REAL(kind=
dp) :: brcut, zeff, zeff_correction
1020 IF (
PRESENT(basis_type))
THEN
1021 my_basis_type = basis_type
1023 my_basis_type =
"ORB"
1026 IF (
ASSOCIATED(qs_kind_set))
THEN
1028 IF (
PRESENT(maxcgf)) maxcgf = 0
1029 IF (
PRESENT(maxco)) maxco = 0
1030 IF (
PRESENT(maxco_proj)) maxco_proj = 0
1031 IF (
PRESENT(maxg_iso_not0)) maxg_iso_not0 = 0
1032 IF (
PRESENT(maxgtops)) maxgtops = 0
1033 IF (
PRESENT(maxlgto)) maxlgto = -1
1034 IF (
PRESENT(maxlppl)) maxlppl = -1
1035 IF (
PRESENT(maxlppnl)) maxlppnl = -1
1036 IF (
PRESENT(maxpol)) maxpol = -1
1037 IF (
PRESENT(maxlprj)) maxlprj = -1
1038 IF (
PRESENT(maxnset)) maxnset = 0
1039 IF (
PRESENT(maxppnl)) maxppnl = 0
1040 IF (
PRESENT(maxsgf)) maxsgf = 0
1041 IF (
PRESENT(maxsgf_set)) maxsgf_set = 0
1042 IF (
PRESENT(ncgf)) ncgf = 0
1043 IF (
PRESENT(nelectron)) nelectron = 0
1044 IF (
PRESENT(npgf)) npgf = 0
1045 IF (
PRESENT(nset)) nset = 0
1046 IF (
PRESENT(nsgf)) nsgf = 0
1047 IF (
PRESENT(nshell)) nshell = 0
1048 IF (
PRESENT(all_potential_present)) all_potential_present = .false.
1049 IF (
PRESENT(tnadd_potential_present)) tnadd_potential_present = .false.
1050 IF (
PRESENT(gth_potential_present)) gth_potential_present = .false.
1051 IF (
PRESENT(sgp_potential_present)) sgp_potential_present = .false.
1052 IF (
PRESENT(cneo_potential_present)) cneo_potential_present = .false.
1053 IF (
PRESENT(nkind_q)) nkind_q = 0
1054 IF (
PRESENT(natom_q)) natom_q = 0
1055 IF (
PRESENT(paw_atom_present)) paw_atom_present = .false.
1056 IF (
PRESENT(max_ngrid_rad)) max_ngrid_rad = 0
1057 IF (
PRESENT(max_sph_harm)) max_sph_harm = 0
1058 IF (
PRESENT(lmax_rho0)) lmax_rho0 = 0
1059 IF (
PRESENT(basis_rcut)) basis_rcut = 0.0_dp
1060 IF (
PRESENT(total_zeff_corr)) total_zeff_corr = 0.0_dp
1061 IF (
PRESENT(npgf_seg)) npgf_seg = 0
1062 IF (
PRESENT(do_mtlr_present)) do_mtlr_present = .false.
1064 nkind =
SIZE(qs_kind_set)
1066 qs_kind => qs_kind_set(ikind)
1068 all_potential=all_potential, &
1069 tnadd_potential=tnadd_potential, &
1070 gth_potential=gth_potential, &
1071 sgp_potential=sgp_potential, &
1072 cneo_potential=cneo_potential, &
1073 paw_proj_set=paw_proj_set, &
1074 dftb_parameter=dftb_parameter, &
1075 ngrid_rad=ngrid_rad, &
1076 max_s_harm=max_s_harm, &
1077 max_iso_not0=max_iso_not0, &
1078 paw_atom=paw_atom, &
1079 dft_plus_u_atom=dft_plus_u_atom, &
1081 lmax_rho0=lmax_rho0_kind)
1083 IF (
PRESENT(maxlppl) .AND.
ASSOCIATED(gth_potential))
THEN
1085 maxlppl = max(maxlppl, 2*(n - 1))
1086 ELSE IF (
PRESENT(maxlppl) .AND.
ASSOCIATED(sgp_potential))
THEN
1087 CALL get_potential(potential=sgp_potential, nrloc=nrloc, ecp_semi_local=ecp_semi_local)
1088 n = maxval(nrloc) - 2
1089 maxlppl = max(maxlppl, 2*(n - 1))
1090 IF (ecp_semi_local)
THEN
1092 n = maxval(nrpot) - 2
1093 n = 2*(n - 1) +
imax
1094 maxlppl = max(maxlppl, n)
1098 IF (
PRESENT(maxlppnl) .AND.
ASSOCIATED(gth_potential))
THEN
1100 maxlppnl = max(maxlppnl,
imax)
1101 ELSE IF (
PRESENT(maxlppnl) .AND.
ASSOCIATED(sgp_potential))
THEN
1103 maxlppnl = max(maxlppnl,
imax)
1106 IF (
PRESENT(maxpol) .AND.
ASSOCIATED(tnadd_potential))
THEN
1108 maxpol = max(maxpol, 2*(n - 1))
1111 IF (
PRESENT(maxco_proj) .AND.
ASSOCIATED(paw_proj_set))
THEN
1113 maxco_proj = max(maxco_proj,
imax)
1116 IF (
PRESENT(maxlprj) .AND.
ASSOCIATED(paw_proj_set))
THEN
1118 maxlprj = max(maxlprj,
imax)
1121 IF (
PRESENT(maxppnl) .AND.
ASSOCIATED(gth_potential))
THEN
1123 maxppnl = max(maxppnl,
imax)
1124 ELSE IF (
PRESENT(maxppnl) .AND.
ASSOCIATED(sgp_potential))
THEN
1126 maxppnl = max(maxppnl,
imax)
1129 IF (my_basis_type(1:3) ==
"NUC" .AND. .NOT.
ASSOCIATED(cneo_potential))
THEN
1130 NULLIFY (tmp_basis_set)
1133 basis_type=my_basis_type)
1136 IF (
PRESENT(maxcgf))
THEN
1137 IF (
ASSOCIATED(tmp_basis_set))
THEN
1139 maxcgf = max(maxcgf,
imax)
1140 ELSE IF (
ASSOCIATED(qs_kind%dftb_parameter))
THEN
1143 maxcgf = max(maxcgf,
imax)
1147 IF (
PRESENT(maxco))
THEN
1148 IF (
ASSOCIATED(tmp_basis_set))
THEN
1149 IF (
PRESENT(maxder))
THEN
1151 maxco=
imax, maxder=maxder)
1155 maxco = max(maxco,
imax)
1157 IF (
ASSOCIATED(gth_potential))
THEN
1161 IF (
ASSOCIATED(sgp_potential))
THEN
1169 IF (
PRESENT(maxgtops))
THEN
1170 IF (
ASSOCIATED(tmp_basis_set))
THEN
1172 maxgtops = max(maxgtops, n*
imax)
1176 IF (
PRESENT(maxlgto))
THEN
1177 IF (
ASSOCIATED(tmp_basis_set))
THEN
1179 maxlgto = max(maxlgto,
imax)
1180 ELSE IF (
ASSOCIATED(qs_kind%dftb_parameter))
THEN
1182 maxlgto = max(maxlgto,
imax)
1186 IF (
PRESENT(maxnset))
THEN
1187 IF (
ASSOCIATED(tmp_basis_set))
THEN
1189 maxnset = max(maxnset, n)
1193 IF (
PRESENT(maxsgf))
THEN
1194 IF (
ASSOCIATED(tmp_basis_set))
THEN
1196 maxsgf = max(maxsgf,
imax)
1200 IF (
PRESENT(maxsgf_set))
THEN
1201 IF (
ASSOCIATED(tmp_basis_set))
THEN
1203 maxsgf_set = max(maxsgf_set,
imax)
1207 IF (
PRESENT(ncgf))
THEN
1208 IF (
ASSOCIATED(tmp_basis_set))
THEN
1210 ncgf = ncgf + n*qs_kind_set(ikind)%natom
1211 ELSE IF (
ASSOCIATED(qs_kind%dftb_parameter))
THEN
1214 ncgf = ncgf + n*qs_kind_set(ikind)%natom
1218 IF (
PRESENT(npgf))
THEN
1219 IF (
ASSOCIATED(tmp_basis_set))
THEN
1221 npgf = npgf + n*qs_kind_set(ikind)%natom
1225 IF (
PRESENT(nset))
THEN
1226 IF (
ASSOCIATED(tmp_basis_set))
THEN
1228 nset = nset + n*qs_kind_set(ikind)%natom
1232 IF (
PRESENT(nsgf))
THEN
1233 IF (
ASSOCIATED(tmp_basis_set))
THEN
1235 nsgf = nsgf + n*qs_kind_set(ikind)%natom
1236 ELSE IF (
ASSOCIATED(qs_kind%dftb_parameter))
THEN
1238 nsgf = nsgf + n*qs_kind_set(ikind)%natom
1242 IF (
PRESENT(nshell))
THEN
1243 IF (
ASSOCIATED(tmp_basis_set))
THEN
1245 nshell = nshell + n*qs_kind_set(ikind)%natom
1246 ELSE IF (
ASSOCIATED(qs_kind%dftb_parameter))
THEN
1248 nshell = nshell + (n + 1)*qs_kind_set(ikind)%natom
1252 IF (
PRESENT(nelectron))
THEN
1253 IF (
ASSOCIATED(qs_kind%all_potential))
THEN
1255 zeff=zeff, zeff_correction=zeff_correction)
1256 ELSE IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
1258 zeff=zeff, zeff_correction=zeff_correction)
1259 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
1261 zeff=zeff, zeff_correction=zeff_correction)
1262 ELSE IF (
ASSOCIATED(qs_kind%cneo_potential))
THEN
1265 zeff_correction = 0.0_dp
1268 zeff_correction = 0.0_dp
1270 nelectron = nelectron + qs_kind_set(ikind)%natom*nint(zeff - zeff_correction)
1273 IF (
PRESENT(basis_rcut))
THEN
1274 IF (
ASSOCIATED(tmp_basis_set))
THEN
1276 basis_rcut = max(basis_rcut, brcut)
1277 ELSE IF (
ASSOCIATED(qs_kind%dftb_parameter))
THEN
1279 basis_rcut = max(basis_rcut, brcut)
1283 IF (
PRESENT(total_zeff_corr))
THEN
1284 IF (
ASSOCIATED(qs_kind%all_potential))
THEN
1286 zeff=zeff, zeff_correction=zeff_correction)
1287 ELSE IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
1289 zeff=zeff, zeff_correction=zeff_correction)
1290 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
1292 zeff=zeff, zeff_correction=zeff_correction)
1295 zeff_correction = 0.0_dp
1297 total_zeff_corr = total_zeff_corr + qs_kind_set(ikind)%natom*zeff_correction
1300 IF (
PRESENT(all_potential_present))
THEN
1301 IF (
ASSOCIATED(all_potential))
THEN
1302 all_potential_present = .true.
1306 IF (
PRESENT(tnadd_potential_present))
THEN
1307 IF (
ASSOCIATED(tnadd_potential))
THEN
1308 tnadd_potential_present = .true.
1312 IF (
PRESENT(gth_potential_present))
THEN
1313 IF (
ASSOCIATED(gth_potential))
THEN
1314 gth_potential_present = .true.
1318 IF (
PRESENT(sgp_potential_present))
THEN
1319 IF (
ASSOCIATED(sgp_potential))
THEN
1320 sgp_potential_present = .true.
1324 IF (
PRESENT(cneo_potential_present))
THEN
1325 IF (
ASSOCIATED(cneo_potential))
THEN
1326 cneo_potential_present = .true.
1330 IF (
PRESENT(nkind_q))
THEN
1331 IF (
ASSOCIATED(cneo_potential))
THEN
1332 nkind_q = nkind_q + 1
1336 IF (
PRESENT(natom_q))
THEN
1337 IF (
ASSOCIATED(cneo_potential))
THEN
1338 natom_q = natom_q + qs_kind_set(ikind)%natom
1342 IF (
PRESENT(paw_atom_present))
THEN
1344 paw_atom_present = .true.
1348 IF (
PRESENT(dft_plus_u_atom_present))
THEN
1349 IF (dft_plus_u_atom)
THEN
1350 dft_plus_u_atom_present = .true.
1354 IF (
PRESENT(do_mtlr_present))
THEN
1356 do_mtlr_present = .true.
1360 IF (
PRESENT(max_ngrid_rad))
THEN
1361 max_ngrid_rad = max(max_ngrid_rad, ngrid_rad)
1364 IF (
PRESENT(max_sph_harm))
THEN
1365 max_sph_harm = max(max_sph_harm, max_s_harm)
1368 IF (
PRESENT(maxg_iso_not0))
THEN
1369 maxg_iso_not0 = max(maxg_iso_not0, max_iso_not0)
1372 IF (
PRESENT(lmax_rho0))
THEN
1373 lmax_rho0 = max(lmax_rho0, lmax_rho0_kind)
1376 IF (
PRESENT(npgf_seg))
THEN
1377 IF (
ASSOCIATED(tmp_basis_set))
THEN
1379 npgf_seg = npgf_seg + n*qs_kind_set(ikind)%natom
1385 cpabort(
"The pointer qs_kind_set is not associated")
1396 SUBROUTINE init_qs_kind(qs_kind)
1399 CHARACTER(len=*),
PARAMETER :: routinen =
'init_qs_kind'
1401 CHARACTER(LEN=default_string_length) :: basis_type
1402 INTEGER :: handle, i
1405 CALL timeset(routinen, handle)
1407 cpassert(
ASSOCIATED(qs_kind))
1409 IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
1411 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
1415 DO i = 1,
SIZE(qs_kind%basis_sets, 1)
1416 NULLIFY (tmp_basis_set)
1418 inumbas=i, basis_type=basis_type)
1419 IF (basis_type ==
"") cycle
1420 IF (basis_type ==
"AUX")
THEN
1421 IF (tmp_basis_set%norm_type < 0) tmp_basis_set%norm_type = 1
1424 IF (tmp_basis_set%norm_type < 0) tmp_basis_set%norm_type = 2
1429 CALL timestop(handle)
1431 END SUBROUTINE init_qs_kind
1441 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1443 CHARACTER(len=*),
PARAMETER :: routinen =
'init_qs_kind_set'
1445 INTEGER :: handle, ikind
1448 CALL timeset(routinen, handle)
1450 IF (.NOT.
ASSOCIATED(qs_kind_set))
THEN
1451 cpabort(
"init_qs_kind_set: The pointer qs_kind_set is not associated")
1454 DO ikind = 1,
SIZE(qs_kind_set)
1455 qs_kind => qs_kind_set(ikind)
1456 CALL init_qs_kind(qs_kind)
1459 CALL timestop(handle)
1468 FUNCTION skala_gapw_representation_from_input(force_env_section)
RESULT(representation)
1470 INTEGER :: representation
1472 CHARACTER(LEN=default_path_length) :: model_key, model_name
1473 CHARACTER(LEN=default_string_length) :: functional_key, functional_name
1479 IF (.NOT.
ASSOCIATED(functionals))
RETURN
1485 IF (.NOT.
ASSOCIATED(functional))
EXIT
1486 IF (functional%section%name /=
"GAUXC") cycle
1490 model_key = adjustl(model_name)
1491 functional_key = adjustl(functional_name)
1494 IF (trim(model_key) /=
"" .AND. trim(model_key) /=
"NONE" .AND. &
1495 trim(model_key) /= trim(functional_key))
THEN
1497 i_val=representation)
1502 END FUNCTION skala_gapw_representation_from_input
1513 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1516 LOGICAL,
OPTIONAL :: modify_qs_control
1518 CHARACTER(LEN=default_string_length) :: bsname
1519 INTEGER :: bas1c, ikind, ilevel, nkind, &
1521 LOGICAL :: effective_force_paw, effective_gpw, gpw, &
1522 has_pseudopotential, my_mod_control, &
1524 REAL(
dp) :: max_rad_local_type, rc
1531 my_mod_control = .true.
1532 IF (
PRESENT(modify_qs_control))
THEN
1533 my_mod_control = modify_qs_control
1535 representation = skala_gapw_representation_from_input(force_env_section)
1537 IF (
ASSOCIATED(qs_kind_set))
THEN
1539 IF (my_mod_control) qs_control%gapw_control%non_paw_atoms = .false.
1540 nkind =
SIZE(qs_kind_set)
1544 qs_kind => qs_kind_set(ikind)
1546 CALL get_qs_kind(qs_kind=qs_kind, basis_set=orb_basis)
1547 NULLIFY (gth_potential, sgp_potential)
1548 CALL get_qs_kind(qs_kind=qs_kind, hard_radius=rc, &
1549 max_rad_local=max_rad_local_type, gpw_type_forced=gpw, &
1550 gth_potential=gth_potential, sgp_potential=sgp_potential)
1552 has_pseudopotential =
ASSOCIATED(gth_potential) .OR.
ASSOCIATED(sgp_potential)
1554 effective_force_paw = qs_control%gapw_control%force_paw .OR. &
1555 ASSOCIATED(qs_kind%cneo_potential)
1556 IF (has_pseudopotential)
THEN
1557 SELECT CASE (representation)
1559 effective_gpw = .true.
1560 effective_force_paw = .false.
1562 effective_gpw = .false.
1563 effective_force_paw = .true.
1567 cpabort(
"Unknown GAUXC PSEUDOPOTENTIAL_GAPW_REPRESENTATION value")
1569 IF (
ASSOCIATED(qs_kind%cneo_potential))
THEN
1570 effective_gpw = .false.
1571 effective_force_paw = .true.
1573 qs_kind%gpw_type_forced = effective_gpw
1576 NULLIFY (soft_basis)
1582 qs_control%gapw_control%eps_fit, rc, paw_atom, &
1583 effective_force_paw, effective_gpw)
1585 CALL set_qs_kind(qs_kind=qs_kind, paw_atom=paw_atom)
1587 bas1c = qs_control%gapw_control%basis_1c
1601 cpabort(
"basis_1c type")
1606 basis_1c%name = trim(bsname)//
"_1c"
1610 CALL get_qs_kind(qs_kind=qs_kind, paw_proj_set=paw_proj)
1611 CALL projectors(paw_proj, basis_1c, orb_basis, rc, qs_control, &
1612 max_rad_local_type, force_env_section)
1614 IF (my_mod_control) qs_control%gapw_control%non_paw_atoms = .true.
1618 NULLIFY (qs_kind%grid_atom, qs_kind%harmonics)
1624 IF (my_mod_control)
THEN
1625 IF (qs_control%gapw_control%non_paw_atoms)
THEN
1626 qs_control%gapw_control%nopaw_as_gpw = .true.
1628 qs_control%gapw_control%nopaw_as_gpw = .false.
1632 cpabort(
"The pointer qs_kind_set is not associated")
1642 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1644 INTEGER :: i, ic, ikind, n_nlcc, nc, nexp_nlcc, &
1646 INTEGER,
DIMENSION(:),
POINTER :: nct_nlcc
1647 LOGICAL :: nlcc, nlcc_type, paw_atom
1648 REAL(
dp) :: alpha, coa, cval
1649 REAL(kind=
dp),
DIMENSION(:),
POINTER :: a_nlcc, alpha_nlcc, c_nlcc, fe, rc, rr
1650 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: cval_nlcc, den
1655 IF (
ASSOCIATED(qs_kind_set))
THEN
1658 nkind =
SIZE(qs_kind_set)
1660 qs_kind => qs_kind_set(ikind)
1663 CALL get_qs_kind(qs_kind, gth_potential=gth_potential)
1664 CALL get_qs_kind(qs_kind, sgp_potential=sgp_potential)
1665 IF (
ASSOCIATED(gth_potential))
THEN
1666 CALL get_potential(potential=gth_potential, nlcc_present=nlcc_type, &
1667 nexp_nlcc=nexp_nlcc, alpha_nlcc=alpha_nlcc, nct_nlcc=nct_nlcc, cval_nlcc=cval_nlcc)
1669 nr = qs_kind%grid_atom%nr
1670 rr => qs_kind%grid_atom%rad
1671 ALLOCATE (qs_kind%nlcc_pot(nr, 2), rc(nr), fe(nr))
1672 den => qs_kind%nlcc_pot
1675 alpha = alpha_nlcc(i)
1677 fe(:) = exp(-0.5_dp*rc(:)*rc(:))
1680 cval = cval_nlcc(ic, i)
1682 den(:, 1) = den(:, 1) + fe(:)*rc**(2*ic - 2)*cval
1683 den(:, 2) = den(:, 2) - fe(:)*rc**(2*ic - 1)*coa
1685 den(:, 2) = den(:, 2) + real(2*ic - 2,
dp)*fe(:)*rc**(2*ic - 3)*coa
1691 ELSE IF (
ASSOCIATED(sgp_potential))
THEN
1693 n_nlcc=n_nlcc, a_nlcc=a_nlcc, c_nlcc=c_nlcc)
1695 nr = qs_kind%grid_atom%nr
1696 rr => qs_kind%grid_atom%rad
1697 ALLOCATE (qs_kind%nlcc_pot(nr, 2), rc(nr), fe(nr))
1698 den => qs_kind%nlcc_pot
1702 fe(:) = exp(-alpha*rr(:)*rr(:))
1704 den(:, 1) = den(:, 1) + cval*fe(:)
1705 den(:, 2) = den(:, 2) - 2.0_dp*alpha*cval*rr(:)*fe(:)
1716 cpabort(
"The pointer qs_kind_set is not associated")
1728 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1731 INTEGER :: ikind, nkind
1737 IF (
ASSOCIATED(qs_kind_set))
THEN
1739 nkind =
SIZE(qs_kind_set)
1743 qs_kind => qs_kind_set(ikind)
1745 IF (
ASSOCIATED(qs_kind%cneo_potential))
THEN
1746 CALL get_qs_kind(qs_kind=qs_kind, basis_set=orb_basis, basis_type=
"NUC", &
1749 NULLIFY (soft_basis)
1752 qs_control%gapw_control%eps_fit/ &
1753 sqrt(qs_kind%cneo_potential%zeff), &
1754 rc, paw_atom, .true., .false.)
1761 cpabort(
"The pointer qs_kind_set is not associated")
1772 SUBROUTINE set_potential_file_names(potential_file_names, dft_potential_file_names, &
1773 kind_potential_file_name)
1775 CHARACTER(LEN=default_path_length),
DIMENSION(:), &
1776 INTENT(INOUT),
POINTER :: potential_file_names
1777 CHARACTER(LEN=default_path_length),
DIMENSION(:), &
1778 INTENT(IN) :: dft_potential_file_names
1779 CHARACTER(LEN=*),
INTENT(IN) :: kind_potential_file_name
1781 IF (
ASSOCIATED(potential_file_names))
DEALLOCATE (potential_file_names)
1782 IF (kind_potential_file_name ==
"-")
THEN
1783 ALLOCATE (potential_file_names(
SIZE(dft_potential_file_names)))
1784 potential_file_names(:) = dft_potential_file_names(:)
1786 ALLOCATE (potential_file_names(1))
1787 potential_file_names(1) = kind_potential_file_name
1790 END SUBROUTINE set_potential_file_names
1806 SUBROUTINE read_qs_kind(qs_kind, kind_section, para_env, force_env_section, &
1807 no_fail, method_id, silent)
1813 LOGICAL,
INTENT(IN) :: no_fail
1814 INTEGER,
INTENT(IN) :: method_id
1815 LOGICAL,
INTENT(IN) :: silent
1817 CHARACTER(LEN=*),
PARAMETER :: routinen =
'read_qs_kind'
1818 INTEGER,
PARAMETER :: maxbas = 20
1820 CHARACTER(LEN=2) :: element_symbol
1821 CHARACTER(len=default_path_length) :: kg_potential_fn_kind, potential_fn_kind
1822 CHARACTER(LEN=default_path_length),
DIMENSION(:), &
1823 POINTER :: dft_potential_file_names, &
1824 potential_file_names
1825 CHARACTER(LEN=default_string_length) :: akind_name, basis_type, keyword, &
1826 kgpot_name, kgpot_type, &
1827 potential_name, potential_type, tmp
1828 CHARACTER(LEN=default_string_length),
DIMENSION(4) :: description
1829 CHARACTER(LEN=default_string_length), &
1830 DIMENSION(:),
POINTER :: tmpstringlist
1831 CHARACTER(LEN=default_string_length), &
1832 DIMENSION(maxbas) :: basis_set_form, basis_set_name, &
1834 INTEGER :: handle, i, i_rep, iounit, ipaodesc, ipaopot, ipos, j, jj, k_rep, l, m, &
1835 n_potential_files, n_rep, nb_rep, nexp, ngauss, nlcc, nloc, nnl, norbitals, npaodesc, &
1836 npaopot, nppnl, nspin, nu, plus_u_method_id, z
1837 INTEGER,
DIMENSION(:),
POINTER :: add_el, elec_conf, orbitals
1838 LOGICAL :: check, ecp_semi_local, explicit, explicit_basis, explicit_j, explicit_kgpot, &
1839 explicit_potential, explicit_u, explicit_u_m_j, l_explicit, n_explicit, nobasis, &
1840 nobasis_nuc, section_enabled, subsection_enabled, update_input
1841 REAL(kind=
dp) :: alpha, ccore, mass, r, rc, &
1843 REAL(kind=
dp),
DIMENSION(6) :: error
1844 REAL(kind=
dp),
DIMENSION(:),
POINTER :: a_nl, aloc, anlcc, cloc, cnlcc, nelec, &
1845 proj_shell_charge, &
1846 tmp_perturbation_strength
1847 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: h_nl
1848 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: c_nl
1855 TYPE(
section_vals_type),
POINTER :: basis_section, bs_section, dft_plus_u_section, &
1856 dft_section, enforce_occupation_section, kgpot_section, &
1857 minimum_tracking_linear_response_section, pao_desc_section, pao_pot_section, &
1858 potential_section, spin_section, tensorial_projector_section
1861 CALL timeset(routinen, handle)
1867 NULLIFY (dft_potential_file_names, elec_conf, potential_file_names)
1869 update_input = .true.
1870 basis_set_name(:) =
""
1871 basis_set_type(:) =
""
1872 basis_set_form(:) =
""
1877 kg_potential_fn_kind =
"-"
1878 potential_fn_kind =
"-"
1880 zeff_correction = 0.0_dp
1882 explicit_basis = .false.
1883 explicit_j = .false.
1884 explicit_kgpot = .false.
1885 explicit_potential = .false.
1886 explicit_u = .false.
1887 explicit_u_m_j = .false.
1891 cpassert(n_potential_files > 0)
1892 ALLOCATE (dft_potential_file_names(n_potential_files))
1893 DO i = 1, n_potential_files
1895 c_val=dft_potential_file_names(i))
1899 akind_name = qs_kind%name
1904 c_val=keyword, i_rep_section=i_rep)
1906 IF (keyword == akind_name)
THEN
1913 ipos = index(qs_kind%name,
"_")
1914 IF (((ipos == 2) .OR. (ipos == 3)) .AND. (index(qs_kind%name,
"_ghost") == 0))
THEN
1917 akind_name = qs_kind%name(1:ipos - 1)
1921 c_val=keyword, i_rep_section=i_rep)
1923 IF (keyword == akind_name)
THEN
1934 element_symbol = qs_kind%element_symbol(1:2)
1938 c_val=keyword, i_rep_section=i_rep)
1940 IF (keyword == element_symbol)
THEN
1951 c_val=keyword, i_rep_section=i_rep)
1953 IF (keyword ==
"DEFAULT")
THEN
1954 update_input = .false.
1960 IF (k_rep < 0 .AND. (.NOT. no_fail))
THEN
1961 CALL cp_abort(__location__, &
1962 "No &KIND section was possible to associate to the atomic kind <"// &
1963 trim(akind_name)//
">. The KIND section were also scanned for the"// &
1964 " corresponding element <"//trim(qs_kind%element_symbol)//
">"// &
1965 " and for the DEFAULT section but no match was found. Check your input file!")
1974 keyword_name=
"BASIS_SET", &
1975 explicit=explicit, &
1977 IF (.NOT. explicit) nb_rep = 0
1978 cpassert(nb_rep <= maxbas)
1981 keyword_name=
"BASIS_SET", i_rep_val=i, c_vals=tmpstringlist)
1982 IF (
SIZE(tmpstringlist) == 1)
THEN
1984 basis_set_type(i) =
"ORB"
1985 basis_set_form(i) =
"GTO"
1986 basis_set_name(i) = tmpstringlist(1)
1987 ELSE IF (
SIZE(tmpstringlist) == 2)
THEN
1989 basis_set_type(i) = tmpstringlist(1)
1990 basis_set_form(i) =
"GTO"
1991 basis_set_name(i) = tmpstringlist(2)
1992 ELSE IF (
SIZE(tmpstringlist) == 3)
THEN
1993 basis_set_type(i) = tmpstringlist(1)
1994 basis_set_form(i) = tmpstringlist(2)
1995 basis_set_name(i) = tmpstringlist(3)
1997 CALL cp_abort(__location__, &
1998 "invalid number of BASIS_SET keyword parameters: BASIS_SET [<TYPE>] [<FORM>] <NAME>")
2001 IF (basis_set_form(i) /=
"GTO" .AND. basis_set_form(i) /=
"STO")
THEN
2002 cpabort(
"invalid BASIS_SET FORM parameter")
2008 i_val=qs_kind%pao_basis_size)
2013 c_val=qs_kind%pao_model_file)
2019 ALLOCATE (qs_kind%pao_potentials(npaopot))
2020 DO ipaopot = 1, npaopot
2022 i_val=qs_kind%pao_potentials(ipaopot)%maxl)
2023 CALL section_vals_val_get(pao_pot_section, keyword_name=
"MAX_PROJECTOR", i_rep_section=ipaopot, &
2024 i_val=qs_kind%pao_potentials(ipaopot)%max_projector)
2026 r_val=qs_kind%pao_potentials(ipaopot)%beta)
2028 r_val=qs_kind%pao_potentials(ipaopot)%weight)
2034 ALLOCATE (qs_kind%pao_descriptors(npaodesc))
2035 DO ipaodesc = 1, npaodesc
2037 r_val=qs_kind%pao_descriptors(ipaodesc)%beta)
2038 CALL section_vals_val_get(pao_desc_section, keyword_name=
"SCREENING", i_rep_section=ipaodesc, &
2039 r_val=qs_kind%pao_descriptors(ipaodesc)%screening)
2041 r_val=qs_kind%pao_descriptors(ipaodesc)%weight)
2046 keyword_name=
"ELEC_CONF", n_rep_val=i)
2049 keyword_name=
"ELEC_CONF", i_vals=elec_conf)
2053 keyword_name=
"CORE_CORRECTION", r_val=zeff_correction)
2056 keyword_name=
"POTENTIAL_FILE_NAME", c_val=potential_fn_kind)
2058 keyword_name=
"POTENTIAL_TYPE", c_val=potential_type)
2060 explicit=explicit, keyword_name=
"POTENTIAL", c_vals=tmpstringlist)
2062 IF (
SIZE(tmpstringlist) == 1)
THEN
2064 potential_name = tmpstringlist(1)
2065 IF (potential_type ==
"")
THEN
2066 ipos = index(potential_name,
"-")
2068 potential_type = potential_name(:ipos - 1)
2070 potential_type = potential_name
2073 ELSE IF (
SIZE(tmpstringlist) == 2)
THEN
2074 potential_type = tmpstringlist(1)
2075 potential_name = tmpstringlist(2)
2077 cpabort(
"POTENTIAL input list is not correct")
2084 keyword_name=
"KG_POTENTIAL_FILE_NAME", c_val=kg_potential_fn_kind)
2086 keyword_name=
"KG_POTENTIAL", c_val=kgpot_name)
2090 keyword_name=
"ECP_SEMI_LOCAL", l_val=ecp_semi_local)
2093 qs_kind%covalent_radius =
ptable(z)%covalent_radius*
bohr
2095 keyword_name=
"COVALENT_RADIUS", r_val=r)
2096 IF (r > 0.0_dp) qs_kind%covalent_radius = r
2099 qs_kind%vdw_radius =
ptable(z)%vdw_radius*
bohr
2101 keyword_name=
"VDW_RADIUS", r_val=r)
2102 IF (r > 0.0_dp) qs_kind%vdw_radius = r
2106 keyword_name=
"HARD_EXP_RADIUS")
2109 qs_kind%hard_radius = 1.2_dp
2111 qs_kind%hard_radius = 0.8_dp*
bohr
2115 keyword_name=
"HARD_EXP_RADIUS", r_val=qs_kind%hard_radius)
2120 keyword_name=
"RHO0_EXP_RADIUS")
2122 qs_kind%hard0_radius = qs_kind%hard_radius
2125 keyword_name=
"RHO0_EXP_RADIUS", r_val=qs_kind%hard0_radius)
2127 IF (qs_kind%hard_radius < qs_kind%hard0_radius)
THEN
2128 cpabort(
"rc0 should be <= rc")
2132 keyword_name=
"MAX_RAD_LOCAL", r_val=qs_kind%max_rad_local)
2134 keyword_name=
"LEBEDEV_GRID", i_val=qs_kind%ngrid_ang)
2135 IF (qs_kind%ngrid_ang <= 0)
THEN
2136 cpabort(
"# point lebedev grid < 0")
2139 keyword_name=
"RADIAL_GRID", i_val=qs_kind%ngrid_rad)
2140 IF (qs_kind%ngrid_rad <= 0)
THEN
2141 cpabort(
"# point radial grid < 0")
2144 keyword_name=
"GPW_TYPE", l_val=qs_kind%gpw_type_forced)
2146 keyword_name=
"GHOST", l_val=qs_kind%ghost)
2148 keyword_name=
"FLOATING_BASIS_CENTER", l_val=qs_kind%floating)
2150 keyword_name=
"NO_OPTIMIZE", l_val=qs_kind%no_optimize)
2154 keyword_name=
"MAGNETIZATION", r_val=qs_kind%magnetization)
2157 keyword_name=
"DFTB3_PARAM", r_val=qs_kind%dudq_dftb3)
2159 keyword_name=
"LMAX_DFTB", i_val=qs_kind%lmax_dftb)
2163 keyword_name=
"MAO", i_val=qs_kind%mao)
2167 keyword_name=
"MONOVALENT", l_val=qs_kind%monovalent)
2168 IF (qs_kind%monovalent .AND. trim(potential_type) /=
'GTH')
THEN
2169 cpabort(
"Monovalent pseudopotentials currently implemented for GTH only!")
2173 NULLIFY (bs_section)
2175 i_rep_section=k_rep)
2176 section_enabled = .false.
2178 l_val=section_enabled)
2179 IF (section_enabled)
THEN
2181 IF (qs_kind%magnetization /= 0.0_dp)
THEN
2182 CALL cp_abort(__location__,
"BS Section is in conflict with non-zero magnetization "// &
2183 "for this atom kind.")
2185 qs_kind%bs_occupation = .true.
2187 NULLIFY (spin_section)
2193 keyword_name=
"NEL", i_vals=add_el)
2194 cpassert(
ASSOCIATED(add_el))
2195 ALLOCATE (qs_kind%addel(
SIZE(add_el), 2))
2197 qs_kind%addel(1:
SIZE(add_el), 1) = add_el(1:
SIZE(add_el))
2200 keyword_name=
"L", i_vals=add_el)
2201 cpassert(
ASSOCIATED(add_el))
2202 cpassert(
SIZE(add_el) ==
SIZE(qs_kind%addel, 1))
2203 ALLOCATE (qs_kind%laddel(
SIZE(add_el), 2))
2205 qs_kind%laddel(1:
SIZE(add_el), 1) = add_el(1:
SIZE(add_el))
2206 ALLOCATE (qs_kind%naddel(
SIZE(add_el), 2))
2210 keyword_name=
"N", n_rep_val=i)
2213 keyword_name=
"N", i_vals=add_el)
2214 IF (
SIZE(add_el) ==
SIZE(qs_kind%addel, 1))
THEN
2215 qs_kind%naddel(1:
SIZE(add_el), 1) = add_el(1:
SIZE(add_el))
2220 NULLIFY (spin_section)
2226 keyword_name=
"NEL", i_vals=add_el)
2227 cpassert(
SIZE(add_el) ==
SIZE(qs_kind%addel, 1))
2228 qs_kind%addel(1:
SIZE(add_el), 2) = add_el(1:
SIZE(add_el))
2229 qs_kind%addel(:, :) = qs_kind%addel(:, :)
2232 keyword_name=
"L", i_vals=add_el)
2233 cpassert(
SIZE(add_el) ==
SIZE(qs_kind%addel, 1))
2234 qs_kind%laddel(1:
SIZE(add_el), 2) = add_el(1:
SIZE(add_el))
2237 keyword_name=
"N", n_rep_val=i)
2241 keyword_name=
"N", i_vals=add_el)
2242 IF (
SIZE(add_el) ==
SIZE(qs_kind%addel, 1))
THEN
2243 qs_kind%naddel(1:
SIZE(add_el), 2) = add_el(1:
SIZE(add_el))
2251 NULLIFY (dft_plus_u_section)
2253 subsection_name=
"DFT_PLUS_U", &
2254 i_rep_section=k_rep)
2255 section_enabled = .false.
2257 keyword_name=
"_SECTION_PARAMETERS_", &
2258 l_val=section_enabled)
2259 IF (section_enabled)
THEN
2260 ALLOCATE (qs_kind%dft_plus_u)
2261 NULLIFY (qs_kind%dft_plus_u%nelec)
2262 NULLIFY (qs_kind%dft_plus_u%orbitals)
2266 qs_kind%dft_plus_u%l = l
2267#if defined(__SIRIUS)
2271 qs_kind%dft_plus_u%n = nu
2275 r_val=qs_kind%dft_plus_u%U, &
2276 explicit=explicit_u)
2280 r_val=qs_kind%dft_plus_u%J, &
2281 explicit=explicit_j)
2284 keyword_name=
"alpha", &
2285 r_val=qs_kind%dft_plus_u%alpha)
2288 keyword_name=
"beta", &
2289 r_val=qs_kind%dft_plus_u%beta)
2292 keyword_name=
"J0", &
2293 r_val=qs_kind%dft_plus_u%J0)
2296 keyword_name=
"occupation", &
2297 r_val=qs_kind%dft_plus_u%occupation)
2303 keyword_name=
"U_MINUS_J", &
2304 r_val=qs_kind%dft_plus_u%u_minus_j_target, &
2305 explicit=explicit_u_m_j)
2308 keyword_name=
"PLUS_U_METHOD", &
2309 i_val=plus_u_method_id)
2312 IF (explicit_u)
THEN
2313 CALL cp_abort(__location__,
"Lowdin and tensorial DFT+U+J do not allow U "// &
2314 "to be specified. Use U_MINUS_J and J.")
2317 IF ((explicit_u .OR. explicit_j) .AND. explicit_u_m_j)
THEN
2318 cpabort(
"DFT+U| specifying U or J and U_MINUS_J parameters are mutually exclusive.")
2323 l_explicit = .false.
2324 n_explicit = .false.
2325 explicit_j = .false.
2330 i_val=qs_kind%dft_plus_u%l, &
2331 explicit=l_explicit)
2334 i_val=qs_kind%dft_plus_u%n, &
2335 explicit=n_explicit)
2338 r_val=qs_kind%dft_plus_u%J, &
2339 explicit=explicit_j)
2340 qs_kind%dft_plus_u%hund_j = qs_kind%dft_plus_u%J
2341 IF (.NOT. l_explicit .OR. .NOT. n_explicit)
THEN
2342 CALL cp_abort(__location__,
"DFT PLUS_U_METHOD TENSORIAL requires explicit L "// &
2343 "and N keywords in every active DFT_PLUS_U section.")
2350 r_val=qs_kind%dft_plus_u%J, &
2351 explicit=explicit_j)
2352 qs_kind%dft_plus_u%hund_j = qs_kind%dft_plus_u%J
2356 keyword_name=
"U_RAMPING", &
2357 r_val=qs_kind%dft_plus_u%u_ramping)
2359 keyword_name=
"INIT_U_RAMPING_EACH_SCF", &
2360 l_val=qs_kind%dft_plus_u%init_u_ramping_each_scf)
2361 IF (qs_kind%dft_plus_u%u_ramping > 0.0_dp)
THEN
2362 qs_kind%dft_plus_u%u_minus_j = 0.0_dp
2364 qs_kind%dft_plus_u%u_minus_j = qs_kind%dft_plus_u%u_minus_j_target
2367 keyword_name=
"EPS_U_RAMPING", &
2368 r_val=qs_kind%dft_plus_u%eps_u_ramping)
2370 NULLIFY (enforce_occupation_section)
2372 subsection_name=
"ENFORCE_OCCUPATION")
2373 subsection_enabled = .false.
2375 keyword_name=
"_SECTION_PARAMETERS_", &
2376 l_val=subsection_enabled)
2377 IF (subsection_enabled)
THEN
2380 keyword_name=
"NELEC", &
2383 ALLOCATE (qs_kind%dft_plus_u%nelec(nspin))
2384 qs_kind%dft_plus_u%nelec(:) = nelec(:)
2387 keyword_name=
"ORBITALS", &
2389 norbitals =
SIZE(orbitals)
2390 IF (norbitals <= 0 .OR. norbitals > 2*l + 1)
THEN
2391 CALL cp_abort(__location__,
"DFT+U| Invalid number of ORBITALS specified: "// &
2392 "1 to 2*L+1 integer numbers are expected")
2394 ALLOCATE (qs_kind%dft_plus_u%orbitals(norbitals))
2395 qs_kind%dft_plus_u%orbitals(:) = orbitals(:)
2398 IF (qs_kind%dft_plus_u%orbitals(m) > l)
THEN
2399 cpabort(
"DFT+U| Invalid orbital magnetic quantum number specified: m > l")
2401 IF (qs_kind%dft_plus_u%orbitals(m) < -l)
THEN
2402 cpabort(
"DFT+U| Invalid orbital magnetic quantum number specified: m < -l")
2406 IF (qs_kind%dft_plus_u%orbitals(j) == qs_kind%dft_plus_u%orbitals(m))
THEN
2407 cpabort(
"DFT+U| An orbital magnetic quantum number was specified twice")
2413 keyword_name=
"EPS_SCF", &
2414 r_val=qs_kind%dft_plus_u%eps_scf)
2416 keyword_name=
"MAX_SCF", &
2418 qs_kind%dft_plus_u%max_scf = max(-1, i)
2420 keyword_name=
"SMEAR", &
2421 l_val=qs_kind%dft_plus_u%smear)
2424 NULLIFY (tensorial_projector_section)
2426 subsection_name=
"ATOMIC_PROJECTOR_TENSORIAL")
2427 subsection_enabled = .false.
2429 keyword_name=
"_SECTION_PARAMETERS_", &
2430 l_val=subsection_enabled)
2431 IF (subsection_enabled)
THEN
2433 keyword_name=
"SHELL_CHARGE", &
2434 r_vals=proj_shell_charge)
2435 qs_kind%dft_plus_u%proj_shell_charge = proj_shell_charge
2438 NULLIFY (minimum_tracking_linear_response_section)
2440 subsection_name=
"MINIMUM_TRACKING_LINEAR_RESPONSE")
2441 subsection_enabled = .false.
2443 keyword_name=
"_SECTION_PARAMETERS_", &
2444 l_val=subsection_enabled)
2445 IF (subsection_enabled)
THEN
2446 qs_kind%dft_plus_u%do_mtlr = .true.
2448 keyword_name=
"INDEX_PERTURBED_ATOM", &
2449 i_val=qs_kind%dft_plus_u%lr_atom)
2450 IF (qs_kind%dft_plus_u%lr_atom < 1)
THEN
2451 cpabort(
"MTLR requires an explicit positive INDEX_PERTURBED_ATOM.")
2453 NULLIFY (tmp_perturbation_strength)
2455 keyword_name=
"PERTURBATION_STRENGTH", &
2456 r_vals=tmp_perturbation_strength)
2457 IF (.NOT.
ASSOCIATED(tmp_perturbation_strength))
THEN
2458 cpabort(
"MTLR perturbation strengths could not be read.")
2460 IF (
SIZE(tmp_perturbation_strength) < 3 .OR.
SIZE(tmp_perturbation_strength) > 9)
THEN
2461 CALL cp_abort(__location__, &
2462 "PERTURBATION_STRENGTH must contain between 3 and 9 values.")
2464 IF (maxval(tmp_perturbation_strength) - minval(tmp_perturbation_strength) <= &
2465 100.0_dp*epsilon(1.0_dp))
THEN
2466 cpabort(
"MTLR perturbation strengths must contain distinct values.")
2468 IF (
ALLOCATED(qs_kind%dft_plus_u%perturbation_strength))
THEN
2469 DEALLOCATE (qs_kind%dft_plus_u%perturbation_strength)
2471 ALLOCATE (qs_kind%dft_plus_u%perturbation_strength(
SIZE(tmp_perturbation_strength)))
2472 qs_kind%dft_plus_u%perturbation_strength(:) = tmp_perturbation_strength(:)
2475 NULLIFY (tmp_perturbation_strength)
2486 explicit_basis = .false.
2489 can_return_null=.true.)
2493 explicit_potential = .false.
2496 i_rep_section=k_rep, can_return_null=.true.)
2500 explicit_kgpot = .false.
2503 i_rep_section=k_rep, can_return_null=.true.)
2507 CALL set_potential_file_names(potential_file_names, dft_potential_file_names, potential_fn_kind)
2509 SELECT CASE (method_id)
2516 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2517 CALL get_potential(potential=qs_kind%all_potential, elec_conf=elec_conf)
2520 cpassert(.NOT. qs_kind%floating)
2521 IF (qs_kind%ghost)
THEN
2522 CALL get_qs_kind(qs_kind=qs_kind, elec_conf=elec_conf)
2525 elec_conf=elec_conf)
2529 zeff_correction=0.0_dp)
2534 check = .NOT.
ASSOCIATED(qs_kind%se_parameter)
2542 keyword_name=
"SE_P_ORBITALS_ON_H", l_val=qs_kind%se_parameter%p_orbitals_on_h)
2550 NULLIFY (tmp_basis_set)
2551 CALL init_se_param(qs_kind%se_parameter, tmp_basis_set, ngauss)
2554 zeff=qs_kind%se_parameter%zeff, zeff_correction=zeff_correction)
2555 qs_kind%se_parameter%zeff = qs_kind%se_parameter%zeff - zeff_correction
2557 check = ((potential_name /=
'') .OR. explicit_potential) .AND. .NOT. silent
2559 CALL cp_warn(__location__, &
2560 "Information provided in the input file regarding POTENTIAL for KIND <"// &
2561 trim(qs_kind%name)//
"> will be ignored!")
2564 check = ((k_rep > 0) .OR. explicit_basis) .AND. .NOT. silent
2566 CALL cp_warn(__location__, &
2567 "Information provided in the input file regarding BASIS for KIND <"// &
2568 trim(qs_kind%name)//
"> will be ignored!")
2576 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2577 CALL get_potential(potential=qs_kind%all_potential, elec_conf=elec_conf)
2580 cpassert(.NOT. qs_kind%floating)
2581 IF (qs_kind%ghost)
THEN
2582 CALL get_qs_kind(qs_kind=qs_kind, elec_conf=elec_conf)
2585 elec_conf=elec_conf)
2589 zeff_correction=0.0_dp)
2592 check = ((potential_name /=
'') .OR. explicit_potential) .AND. .NOT. silent
2594 CALL cp_warn(__location__, &
2595 "Information provided in the input file regarding POTENTIAL for KIND <"// &
2596 trim(qs_kind%name)//
"> will be ignored!")
2599 check = ((k_rep > 0) .OR. explicit_basis) .AND. .NOT. silent
2601 CALL cp_warn(__location__, &
2602 "Information provided in the input file regarding BASIS for KIND <"// &
2603 trim(qs_kind%name)//
"> will be ignored!")
2611 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2612 CALL get_potential(potential=qs_kind%all_potential, elec_conf=elec_conf)
2615 cpassert(.NOT. qs_kind%floating)
2616 IF (qs_kind%ghost)
THEN
2617 CALL get_qs_kind(qs_kind=qs_kind, elec_conf=elec_conf)
2620 elec_conf=elec_conf)
2624 zeff_correction=0.0_dp)
2627 check = ((potential_name /=
'') .OR. explicit_potential) .AND. .NOT. silent
2629 CALL cp_warn(__location__, &
2630 "Information provided in the input file regarding POTENTIAL for KIND <"// &
2631 trim(qs_kind%name)//
"> will be ignored!")
2634 check = ((k_rep > 0) .OR. explicit_basis) .AND. .NOT. silent
2636 CALL cp_warn(__location__, &
2637 "Information provided in the input file regarding BASIS for KIND <"// &
2638 trim(qs_kind%name)//
"> will be ignored!")
2644 IF (potential_name /=
'')
THEN
2645 SELECT CASE (trim(potential_type))
2646 CASE (
"ALL",
"ECP",
"CNEO")
2647 CALL cp_abort(__location__, &
2648 "PW DFT calculations only with potential type UPF or GTH possible."// &
2649 " <"//trim(potential_type)//
"> was specified "// &
2650 "for the atomic kind <"//trim(qs_kind%name))
2654 qs_kind%gth_potential, zeff_correction, para_env, &
2655 potential_file_names, potential_section, update_input, &
2656 monovalent=qs_kind%monovalent)
2659 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2660 CALL get_potential(potential=qs_kind%gth_potential, elec_conf=elec_conf)
2663 CALL set_potential(potential=qs_kind%gth_potential, elec_conf=elec_conf)
2666 ALLOCATE (qs_kind%upf_potential)
2667 qs_kind%upf_potential%zion = 0
2668 qs_kind%upf_potential%filename = adjustl(trim(potential_name))
2670 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2671 CALL set_qs_kind(qs_kind, elec_conf=qs_kind%upf_potential%econf)
2674 CALL cp_abort(__location__, &
2675 "An invalid potential type <"// &
2676 trim(potential_type)//
"> was specified "// &
2677 "for the atomic kind <"// &
2681 CALL cp_abort(__location__, &
2682 "No potential type was defined for the "// &
2683 "atomic kind <"//trim(qs_kind%name)//
">")
2693 SELECT CASE (basis_set_form(i))
2695 NULLIFY (tmp_basis_set)
2698 tmp_basis_set, para_env, dft_section)
2700 NULLIFY (sto_basis_set)
2703 sto_basis_set, para_env, dft_section)
2704 NULLIFY (tmp_basis_set)
2708 CALL cp_abort(__location__, &
2709 "Invalid basis set form "//trim(basis_set_form(i))// &
2710 "for atomic kind <"//trim(qs_kind%name)//
">")
2712 tmp = basis_set_type(i)
2717 IF (explicit_basis)
THEN
2720 NULLIFY (tmp_basis_set)
2723 tmp_basis_set, basis_section, i, dft_section)
2730 DO i = 1,
SIZE(qs_kind%basis_sets)
2731 NULLIFY (tmp_basis_set)
2733 inumbas=i, basis_type=basis_type)
2734 IF (basis_type ==
"") cycle
2736 DO j = i + 1,
SIZE(qs_kind%basis_sets)
2738 NULLIFY (sup_basis_set)
2740 inumbas=jj, basis_type=tmp)
2741 IF (basis_type == tmp)
THEN
2748 NULLIFY (sup_basis_set)
2753 DO i = 1,
SIZE(qs_kind%basis_sets)
2754 NULLIFY (tmp_basis_set)
2756 inumbas=i, basis_type=basis_type)
2757 IF (basis_type ==
"ORB") nobasis = .false.
2760 CALL cp_abort(__location__, &
2761 "No basis set type was defined for the "// &
2762 "atomic kind <"//trim(qs_kind%name)//
">")
2766 IF (qs_kind%ghost .OR. qs_kind%floating)
THEN
2767 IF (
ASSOCIATED(qs_kind%elec_conf)) qs_kind%elec_conf = 0
2770 IF ((potential_name /=
'') .OR. explicit_potential)
THEN
2771 SELECT CASE (trim(potential_type))
2775 qs_kind%all_potential, zeff_correction, para_env, &
2776 potential_file_names, potential_section, update_input)
2779 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2780 CALL get_potential(potential=qs_kind%all_potential, elec_conf=elec_conf)
2783 CALL set_potential(potential=qs_kind%all_potential, elec_conf=elec_conf)
2788 qs_kind%gth_potential, zeff_correction, para_env, &
2789 potential_file_names, potential_section, update_input, &
2790 monovalent=qs_kind%monovalent)
2793 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2794 CALL get_potential(potential=qs_kind%gth_potential, elec_conf=elec_conf)
2797 CALL set_potential(potential=qs_kind%gth_potential, elec_conf=elec_conf)
2801 CALL get_potential(qs_kind%sgp_potential, description=description)
2803 potential_name, potential_file_names, potential_section)
2804 IF (ecp_semi_local)
THEN
2805 description(1) =
"Semi-local Gaussian pseudopotential "
2806 description(2) =
"ECP "//trim(potential_name)
2807 description(3) =
"LIBGRPP: A. V. Oleynichenko et al., Symmetry 15 197 2023"
2808 description(4) =
" "
2810 description(4) =
"ECP "//trim(potential_name)
2812 CALL set_potential(qs_kind%sgp_potential, name=ecppot%pname, description=description, &
2813 zeff=ecppot%zion, z=z, ecp_local=.true., ecp_semi_local=ecp_semi_local, &
2814 nloc=ecppot%nloc, nrloc=ecppot%nrloc, aloc=ecppot%aloc, bloc=ecppot%bloc, &
2816 CALL set_potential(qs_kind%sgp_potential, sl_lmax=ecppot%lmax, &
2817 npot=ecppot%npot, nrpot=ecppot%nrpot, apot=ecppot%apot, bpot=ecppot%bpot)
2819 IF (.NOT. ecp_semi_local)
THEN
2820 cpabort(
"ECPs are only well tested in their semi-local form")
2821 CALL get_qs_kind(qs_kind, basis_set=orb_basis_set)
2822 CALL sgp_construction(sgp_pot=sgppot, ecp_pot=ecppot, orb_basis=orb_basis_set, error=error)
2823 IF (iounit > 0 .AND. .NOT. silent)
THEN
2824 WRITE (iounit,
"(/,T2,'PP Transformation for ',A)") trim(ecppot%pname)
2825 IF (sgppot%has_local)
THEN
2826 WRITE (iounit,
"(T8,'Accuracy for local part:',T41,F10.3,'%',T61,F20.12)") error(4), error(1)
2828 IF (sgppot%has_nonlocal)
THEN
2829 WRITE (iounit,
"(T8,'Accuracy for nonlocal part:',T41,F10.3,'%',T61,F20.12)") error(5), error(2)
2831 IF (sgppot%has_nlcc)
THEN
2832 WRITE (iounit,
"(T8,'Accuracy for NLCC density:',T61,F20.12)") error(3)
2836 IF (sgppot%has_nonlocal)
THEN
2837 CALL set_potential(qs_kind%sgp_potential, n_nonlocal=sgppot%n_nonlocal, lmax=sgppot%lmax, &
2838 is_nonlocal=sgppot%is_nonlocal)
2839 nnl = sgppot%n_nonlocal
2841 DO l = 0, sgppot%lmax
2842 nppnl = nppnl + nnl*
nco(l)
2845 ALLOCATE (a_nl(nnl), h_nl(nnl, 0:l), c_nl(nnl, nnl, 0:l))
2846 a_nl(:) = sgppot%a_nonlocal(:)
2847 h_nl(:, :) = sgppot%h_nonlocal(:, :)
2848 DO l = 0, sgppot%lmax
2849 c_nl(:, :, l) = sgppot%c_nonlocal(:, :, l)*sqrt(2._dp*l + 1.0_dp)
2851 CALL set_potential(qs_kind%sgp_potential, nppnl=nppnl, a_nonlocal=a_nl, h_nonlocal=h_nl, c_nonlocal=c_nl)
2853 CALL set_potential(qs_kind%sgp_potential, n_nonlocal=0, lmax=-1, is_nonlocal=sgppot%is_nonlocal)
2857 cpassert(.NOT. sgppot%has_local)
2858 cpassert(.NOT. sgppot%has_nlcc)
2860 rc = 0.5_dp*qs_kind%covalent_radius*
angstrom
2861 rc = max(rc, 0.2_dp)
2862 rc = min(rc, 1.0_dp)
2863 alpha = 1.0_dp/(2.0_dp*rc**2)
2864 ccore = ecppot%zion*sqrt((alpha/
pi)**3)
2865 CALL set_potential(qs_kind%sgp_potential, alpha_core_charge=alpha, ccore_charge=ccore, &
2866 core_charge_radius=rc)
2869 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2873 CALL set_potential(qs_kind%sgp_potential, elec_conf=elec_conf)
2876 CALL get_potential(qs_kind%sgp_potential, description=description)
2877 description(4) =
"UPF "//trim(potential_name)
2879 CALL set_potential(qs_kind%sgp_potential, name=upfpot%pname, description=description, &
2880 zeff=upfpot%zion, z=z,
has_nlcc=upfpot%core_correction)
2883 IF (iounit > 0 .AND. .NOT. silent)
THEN
2884 WRITE (iounit,
"(/,T2,'PP Transformation for ',A)") trim(upfpot%pname)
2885 IF (sgppot%has_local)
THEN
2886 WRITE (iounit,
"(T8,'Accuracy for local part:',T61,F20.12)") error(1)
2888 IF (sgppot%has_nonlocal)
THEN
2889 WRITE (iounit,
"(T8,'Accuracy for nonlocal part:',T61,F20.12)") error(2)
2891 IF (sgppot%has_nlcc)
THEN
2892 WRITE (iounit,
"(T8,'Accuracy for NLCC density:',T61,F20.12)") error(3)
2895 IF (sgppot%has_nonlocal)
THEN
2896 CALL set_potential(qs_kind%sgp_potential, n_nonlocal=sgppot%n_nonlocal, lmax=sgppot%lmax, &
2897 is_nonlocal=sgppot%is_nonlocal)
2898 nnl = sgppot%n_nonlocal
2900 DO l = 0, sgppot%lmax
2901 nppnl = nppnl + nnl*
nco(l)
2904 ALLOCATE (a_nl(nnl), h_nl(nnl, 0:l), c_nl(nnl, nnl, 0:l))
2905 a_nl(:) = sgppot%a_nonlocal(:)
2906 h_nl(:, :) = sgppot%h_nonlocal(:, :)
2907 c_nl(:, :, :) = sgppot%c_nonlocal(:, :, :)
2908 CALL set_potential(qs_kind%sgp_potential, nppnl=nppnl, a_nonlocal=a_nl, h_nonlocal=h_nl, c_nonlocal=c_nl)
2910 CALL set_potential(qs_kind%sgp_potential, n_nonlocal=0, lmax=-1, is_nonlocal=sgppot%is_nonlocal)
2913 cpassert(sgppot%has_local)
2915 rc = sgppot%ac_local
2916 alpha = 1.0_dp/(2.0_dp*rc**2)
2917 ccore = upfpot%zion*sqrt((alpha/
pi)**3)
2918 CALL set_potential(qs_kind%sgp_potential, alpha_core_charge=alpha, ccore_charge=ccore, &
2919 core_charge_radius=rc)
2921 nloc = sgppot%n_local
2922 ALLOCATE (aloc(nloc), cloc(nloc))
2923 aloc(1:nloc) = sgppot%a_local(1:nloc)
2924 cloc(1:nloc) = sgppot%c_local(1:nloc)
2925 CALL set_potential(qs_kind%sgp_potential, n_local=nloc, a_local=aloc, c_local=cloc)
2926 IF (sgppot%has_nlcc)
THEN
2927 nlcc = sgppot%n_nlcc
2928 ALLOCATE (anlcc(nlcc), cnlcc(nlcc))
2929 anlcc(1:nlcc) = sgppot%a_nlcc(1:nlcc)
2930 cnlcc(1:nlcc) = sgppot%c_nlcc(1:nlcc)
2935 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2939 CALL set_potential(qs_kind%sgp_potential, elec_conf=elec_conf)
2943 IF (zeff_correction /= 0.0_dp)
THEN
2944 cpabort(
"CORE_CORRECTION is not compatible with CNEO")
2954 keyword_name=
"MASS", n_rep_val=i)
2956 keyword_name=
"MASS", r_val=mass)
2959 IF (mass - real(z,
dp)*0.000548579909_dp > 0.0_dp)
THEN
2960 mass = mass - real(z,
dp)*0.000548579909_dp
2966 IF (abs(mass + real(z,
dp)*0.000548579909_dp -
ptable(z)%amass) < 1.e-4_dp)
THEN
2967 CALL cp_warn(__location__, &
2968 "Atomic mass of the atomic kind <"//trim(qs_kind%name)// &
2969 "> is very close to its average mass. Is it a pure isotope? "// &
2970 "Pure isotopes are preferable for CNEO. "// &
2971 "(e.g., mass of 1H is 1.007825, not 1.00794)")
2974 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2981 CALL cp_abort(__location__, &
2982 "An invalid potential type <"// &
2983 trim(potential_name)//
"> was specified "// &
2984 "for the atomic kind <"// &
2988 CALL cp_abort(__location__, &
2989 "No potential type was defined for the "// &
2990 "atomic kind <"//trim(qs_kind%name)//
">")
2993 CALL check_potential_basis_compatibility(qs_kind)
2996 IF ((kgpot_name /=
'') .OR. explicit_kgpot)
THEN
2997 ipos = index(kgpot_name,
"-")
2999 kgpot_type = kgpot_name(:ipos - 1)
3001 kgpot_type = kgpot_name
3005 SELECT CASE (trim(kgpot_type))
3007 CALL set_potential_file_names(potential_file_names, dft_potential_file_names, &
3008 kg_potential_fn_kind)
3011 qs_kind%tnadd_potential, para_env, &
3012 potential_file_names, kgpot_section, update_input)
3014 NULLIFY (qs_kind%tnadd_potential)
3016 CALL cp_abort(__location__, &
3017 "An invalid kg_potential type <"// &
3018 trim(potential_name)//
"> was specified "// &
3019 "for the atomic kind <"// &
3026 nobasis_nuc =
ASSOCIATED(qs_kind%cneo_potential)
3027 DO i = 1,
SIZE(qs_kind%basis_sets)
3028 NULLIFY (tmp_basis_set)
3030 inumbas=i, basis_type=basis_type)
3031 IF (basis_type ==
"NUC")
THEN
3032 nobasis_nuc = .false.
3033 IF (.NOT.
ASSOCIATED(qs_kind%cneo_potential))
THEN
3034 CALL cp_warn(__location__, &
3035 "POTENTIAL is not set to CNEO, NUC type basis set for KIND <"// &
3036 trim(qs_kind%name)//
"> will be ignored!")
3040 IF (nobasis_nuc)
THEN
3041 CALL cp_abort(__location__, &
3042 "No NUC type basis set was defined for the "// &
3043 "atomic kind <"//trim(qs_kind%name)//
">, which is required by "// &
3048 DEALLOCATE (dft_potential_file_names, potential_file_names)
3049 CALL timestop(handle)
3051 END SUBROUTINE read_qs_kind
3058 SUBROUTINE check_potential_basis_compatibility(qs_kind)
3061 CHARACTER(LEN=default_string_length) :: name
3066 CALL get_qs_kind(qs_kind, name=name, gth_potential=gth_potential, basis_set=basis_set)
3069 IF (
ASSOCIATED(gth_potential))
THEN
3070 npp = parse_valence_electrons(gth_potential%aliases)
3072 IF (
ASSOCIATED(basis_set))
THEN
3073 nbs = parse_valence_electrons(basis_set%aliases)
3076 IF (npp >= 0 .AND. nbs >= 0 .AND. npp /= nbs)
THEN
3077 CALL cp_abort(__location__,
"Basis-set and pseudo-potential of atomic kind '"//trim(name)//
"'"// &
3078 " were optimized for different valence electron numbers.")
3081 END SUBROUTINE check_potential_basis_compatibility
3089 FUNCTION parse_valence_electrons(string)
RESULT(n)
3090 CHARACTER(*) :: string
3093 INTEGER :: i, istat, j
3095 i = index(string,
"-Q", .true.)
3099 j = scan(string(i + 2:),
"- ")
3100 READ (string(i + 2:i + j),
'(I3)', iostat=istat) n
3101 IF (istat /= 0) n = -1
3104 END FUNCTION parse_valence_electrons
3116 force_env_section, silent)
3118 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
3123 LOGICAL,
INTENT(IN) :: silent
3125 CHARACTER(len=*),
PARAMETER :: routinen =
'create_qs_kind_set'
3127 INTEGER :: handle, ikind, method, nkind, qs_method
3130 CALL timeset(routinen, handle)
3132 IF (
ASSOCIATED(qs_kind_set)) cpabort(
"create_qs_kind_set: qs_kind_set already associated")
3133 IF (.NOT.
ASSOCIATED(atomic_kind_set)) cpabort(
"create_qs_kind_set: atomic_kind_set not associated")
3139 IF (method ==
do_qs)
THEN
3141 SELECT CASE (qs_method)
3156 nkind =
SIZE(atomic_kind_set)
3157 ALLOCATE (qs_kind_set(nkind))
3160 qs_kind_set(ikind)%name = atomic_kind_set(ikind)%name
3161 qs_kind_set(ikind)%element_symbol = atomic_kind_set(ikind)%element_symbol
3162 qs_kind_set(ikind)%natom = atomic_kind_set(ikind)%natom
3163 CALL read_qs_kind(qs_kind_set(ikind), kind_section, para_env, force_env_section, &
3164 no_fail, qs_method, silent)
3167 CALL timestop(handle)
3178 SUBROUTINE check_qs_kind(qs_kind, dft_control, subsys_section)
3190 IF (dft_control%qs_control%semi_empirical)
THEN
3191 CALL get_qs_kind(qs_kind, se_parameter=se_parameter)
3192 cpassert(
ASSOCIATED(se_parameter))
3196 ELSE IF (dft_control%qs_control%dftb)
THEN
3197 CALL get_qs_kind(qs_kind, dftb_parameter=dftb_parameter)
3198 cpassert(
ASSOCIATED(dftb_parameter))
3202 ELSE IF (dft_control%qs_control%xtb)
THEN
3203 IF (.NOT. (dft_control%qs_control%xtb_control%do_tblite))
THEN
3204 CALL get_qs_kind(qs_kind, xtb_parameter=xtb_parameter)
3205 cpassert(
ASSOCIATED(xtb_parameter))
3206 gfn_type = dft_control%qs_control%xtb_control%gfn_type
3211 END SUBROUTINE check_qs_kind
3221 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
3225 CHARACTER(len=*),
PARAMETER :: routinen =
'check_qs_kind_set'
3227 INTEGER :: handle, ikind, nkind
3230 CALL timeset(routinen, handle)
3231 IF (
ASSOCIATED(qs_kind_set))
THEN
3232 nkind =
SIZE(qs_kind_set)
3234 qs_kind => qs_kind_set(ikind)
3235 CALL check_qs_kind(qs_kind, dft_control, subsys_section)
3237 IF (dft_control%qs_control%xtb)
THEN
3238 CALL write_xtb_kab_param(qs_kind_set, subsys_section, &
3239 dft_control%qs_control%xtb_control)
3242 cpabort(
"The pointer qs_kind_set is not associated")
3244 CALL timestop(handle)
3253 SUBROUTINE write_xtb_kab_param(qs_kind_set, subsys_section, xtb_control)
3255 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
3259 CHARACTER(LEN=default_string_length) :: aname, bname
3260 INTEGER :: ikind, io_unit, jkind, nkind, za, zb
3263 TYPE(
xtb_atom_type),
POINTER :: xtb_parameter_a, xtb_parameter_b
3268 "PRINT%KINDS/POTENTIAL"),
cp_p_file))
THEN
3271 IF (io_unit > 0)
THEN
3273 WRITE (io_unit,
"(/,T2,A)")
"xTB| Kab parameters"
3274 nkind =
SIZE(qs_kind_set)
3276 qs_kinda => qs_kind_set(ikind)
3277 CALL get_qs_kind(qs_kinda, xtb_parameter=xtb_parameter_a)
3279 DO jkind = ikind, nkind
3280 qs_kindb => qs_kind_set(jkind)
3281 CALL get_qs_kind(qs_kindb, xtb_parameter=xtb_parameter_b)
3283 WRITE (io_unit,
"(A,T10,A15,T25,A15,T71,F10.3)") &
3284 " Kab:", trim(aname), trim(bname),
xtb_set_kab(za, zb, xtb_control)
3294 END SUBROUTINE write_xtb_kab_param
3318 SUBROUTINE set_qs_kind(qs_kind, paw_atom, ghost, floating, hard_radius, hard0_radius, &
3319 covalent_radius, vdw_radius, lmax_rho0, zeff, &
3320 no_optimize, dispersion, u_minus_j, hund_j, reltmat, &
3321 dftb_parameter, xtb_parameter, &
3322 elec_conf, pao_basis_size)
3325 LOGICAL,
INTENT(IN),
OPTIONAL :: paw_atom, ghost, floating
3326 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: hard_radius, hard0_radius, &
3327 covalent_radius, vdw_radius
3328 INTEGER,
INTENT(IN),
OPTIONAL :: lmax_rho0
3329 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: zeff
3330 LOGICAL,
INTENT(IN),
OPTIONAL :: no_optimize
3332 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: u_minus_j, hund_j
3333 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: reltmat
3336 INTEGER,
DIMENSION(:),
INTENT(IN),
OPTIONAL :: elec_conf
3337 INTEGER,
INTENT(IN),
OPTIONAL :: pao_basis_size
3339 IF (
PRESENT(dftb_parameter)) qs_kind%dftb_parameter => dftb_parameter
3340 IF (
PRESENT(xtb_parameter)) qs_kind%xtb_parameter => xtb_parameter
3341 IF (
PRESENT(elec_conf))
THEN
3342 IF (
ASSOCIATED(qs_kind%elec_conf))
THEN
3343 DEALLOCATE (qs_kind%elec_conf)
3345 ALLOCATE (qs_kind%elec_conf(0:
SIZE(elec_conf) - 1))
3346 qs_kind%elec_conf(:) = elec_conf(:)
3348 IF (
PRESENT(paw_atom)) qs_kind%paw_atom = paw_atom
3349 IF (
PRESENT(hard_radius)) qs_kind%hard_radius = hard_radius
3350 IF (
PRESENT(hard0_radius)) qs_kind%hard0_radius = hard0_radius
3351 IF (
PRESENT(covalent_radius)) qs_kind%covalent_radius = covalent_radius
3352 IF (
PRESENT(vdw_radius)) qs_kind%vdw_radius = vdw_radius
3353 IF (
PRESENT(lmax_rho0)) qs_kind%lmax_rho0 = lmax_rho0
3354 IF (
PRESENT(zeff))
THEN
3355 IF (
ASSOCIATED(qs_kind%all_potential))
THEN
3356 CALL set_potential(potential=qs_kind%all_potential, zeff=zeff)
3357 ELSE IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
3358 CALL set_potential(potential=qs_kind%gth_potential, zeff=zeff)
3359 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
3360 CALL set_potential(potential=qs_kind%sgp_potential, zeff=zeff)
3361 ELSE IF (
ASSOCIATED(qs_kind%cneo_potential))
THEN
3362 cpabort(
"CNEO potential ZEFF should not be manually set")
3365 IF (
PRESENT(ghost)) qs_kind%ghost = ghost
3367 IF (
PRESENT(floating)) qs_kind%floating = floating
3369 IF (
PRESENT(no_optimize)) qs_kind%no_optimize = no_optimize
3371 IF (
PRESENT(dispersion)) qs_kind%dispersion => dispersion
3373 IF (
PRESENT(u_minus_j))
THEN
3374 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
3375 qs_kind%dft_plus_u%u_minus_j = u_minus_j
3379 IF (
PRESENT(hund_j))
THEN
3380 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
3381 qs_kind%dft_plus_u%hund_j = hund_j
3385 IF (
PRESENT(reltmat)) qs_kind%reltmat => reltmat
3387 IF (
PRESENT(pao_basis_size)) qs_kind%pao_basis_size = pao_basis_size
3399 SUBROUTINE write_qs_kind(qs_kind, kind_number, output_unit)
3402 INTEGER,
INTENT(in) :: kind_number, output_unit
3404 CHARACTER(LEN=3) :: yon
3405 CHARACTER(LEN=default_string_length) :: basis_type, bstring
3410 IF (output_unit > 0)
THEN
3412 IF (
ASSOCIATED(qs_kind))
THEN
3413 WRITE (unit=output_unit, fmt=
"(/,T2,I2,A,T57,A,T75,I6)") &
3414 kind_number,
". Atomic kind: "//trim(qs_kind%name), &
3415 "Number of atoms: ", qs_kind%natom
3417 DO ibas = 1,
SIZE(qs_kind%basis_sets, 1)
3420 inumbas=ibas, basis_type=basis_type)
3422 SELECT CASE (basis_type)
3424 bstring =
"Basis Set"
3427 bstring =
"Orbital Basis Set"
3429 bstring =
"GAPW Soft Basis Set"
3432 bstring =
"Auxiliary Basis Set"
3434 bstring =
"Minimal Basis Set"
3436 bstring =
"RI Auxiliary Basis Set"
3438 bstring =
"Auxiliary Fit Basis Set"
3440 bstring =
"LRI Basis Set"
3442 bstring =
"LRI Basis Set for TDDFPT"
3444 bstring =
"RI XAS Basis Set"
3446 bstring =
"RI HFX Basis Set"
3448 bstring =
"Nuclear Basis Set"
3451 bstring =
"Nuclear Soft Basis Set"
3461 IF (qs_kind%ghost)
THEN
3462 WRITE (unit=output_unit, fmt=
"(/,T6,A)") &
3463 "The atoms of this atomic kind are GHOST atoms!"
3465 IF (qs_kind%monovalent)
THEN
3466 WRITE (unit=output_unit, fmt=
"(/,T6,A)") &
3467 "The atoms of this atomic kind are MONOVALENT!"
3469 IF (qs_kind%floating)
THEN
3470 WRITE (unit=output_unit, fmt=
"(/,T6,A)") &
3471 "The atoms of this atomic kind are FLOATING BASIS FUNCTIONS."
3473 IF (qs_kind%covalent_radius > 0.0_dp)
THEN
3474 WRITE (unit=output_unit, fmt=
"(/,T8,A,T71,F10.3)") &
3475 "Atomic covalent radius [Angstrom]:", &
3478 IF (qs_kind%vdw_radius > 0.0_dp)
THEN
3479 WRITE (unit=output_unit, fmt=
"(/,T8,A,T71,F10.3)") &
3480 "Atomic van der Waals radius [Angstrom]:", &
3483 IF (qs_kind%paw_atom)
THEN
3484 WRITE (unit=output_unit, fmt=
"(/,T6,A)") &
3485 "The atoms of this atomic kind are PAW atoms (GAPW):"
3486 WRITE (unit=output_unit, fmt=
"(T8,A,T71,F10.3)") &
3487 "Hard Gaussian function radius:", qs_kind%hard_radius, &
3488 "Rho0 radius:", qs_kind%hard0_radius, &
3489 "Maximum GTO radius used for PAW projector construction:", &
3490 qs_kind%max_rad_local
3493 basis_type=
"ORB_SOFT")
3497 IF (
ASSOCIATED(qs_kind%all_potential))
CALL write_potential(qs_kind%all_potential, output_unit)
3498 IF (
ASSOCIATED(qs_kind%gth_potential))
CALL write_potential(qs_kind%gth_potential, output_unit)
3499 IF (
ASSOCIATED(qs_kind%sgp_potential))
CALL write_potential(qs_kind%sgp_potential, output_unit)
3500 IF (
ASSOCIATED(qs_kind%tnadd_potential))
CALL write_potential(qs_kind%tnadd_potential, output_unit)
3501 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
3502 WRITE (unit=output_unit, fmt=
"(/,T6,A,/,T8,A,T76,I5,/,T8,A,T73,F8.3,/,T8,A,T73,F8.3)") &
3503 "A DFT+U correction is applied to atoms of this atomic kind:", &
3504 "Angular quantum momentum number L:", qs_kind%dft_plus_u%l, &
3505 "U(eff) = (U - J) value in [eV]:", qs_kind%dft_plus_u%u_minus_j_target*
evolt, &
3506 "Hund J value in [eV]:", qs_kind%dft_plus_u%hund_j*
evolt
3507 IF (qs_kind%dft_plus_u%u_ramping > 0.0_dp)
THEN
3508 IF (qs_kind%dft_plus_u%init_u_ramping_each_scf)
THEN
3513 WRITE (unit=output_unit, fmt=
"(T8,A,T73,F8.3,/,T8,A,T73,ES8.1,/,T8,A,T78,A3)") &
3514 "Increment for U ramping in [eV]:", qs_kind%dft_plus_u%u_ramping*
evolt, &
3515 "SCF threshold value for U ramping:", qs_kind%dft_plus_u%eps_u_ramping, &
3516 "Set U ramping value to zero before each wavefunction optimisation:", yon
3518 IF (
ASSOCIATED(qs_kind%dft_plus_u%orbitals))
THEN
3519 WRITE (unit=output_unit, fmt=
"(T8,A)") &
3520 "An initial orbital occupation is requested:"
3521 IF (
ASSOCIATED(qs_kind%dft_plus_u%nelec))
THEN
3522 IF (any(qs_kind%dft_plus_u%nelec(:) >= 0.5_dp))
THEN
3523 IF (
SIZE(qs_kind%dft_plus_u%nelec) > 1)
THEN
3524 WRITE (unit=output_unit, fmt=
"(T9,A,T75,F6.2)") &
3525 "Number of alpha electrons:", &
3526 qs_kind%dft_plus_u%nelec(1), &
3527 "Number of beta electrons:", &
3528 qs_kind%dft_plus_u%nelec(2)
3530 WRITE (unit=output_unit, fmt=
"(T9,A,T75,F6.2)") &
3531 "Number of electrons:", &
3532 qs_kind%dft_plus_u%nelec(1)
3536 WRITE (unit=output_unit, fmt=
"(T9,A,(T78,I3))") &
3537 "Preferred (initial) orbital occupation order (orbital M values):", &
3538 qs_kind%dft_plus_u%orbitals(:)
3539 WRITE (unit=output_unit, fmt=
"(T9,A,T71,ES10.3,/,T9,A,T76,I5)") &
3540 "Threshold value for the SCF convergence criterion:", &
3541 qs_kind%dft_plus_u%eps_scf, &
3542 "Number of initial SCF iterations:", &
3543 qs_kind%dft_plus_u%max_scf
3544 IF (qs_kind%dft_plus_u%smear)
THEN
3545 WRITE (unit=output_unit, fmt=
"(T9,A)") &
3546 "A smearing of the orbital occupations will be performed"
3550 IF (
ASSOCIATED(qs_kind%cneo_potential))
THEN
3551 WRITE (unit=output_unit, fmt=
"(/,T6,A)") &
3552 "The nuclei of this atomic kind are quantum mechanical (CNEO)"
3560 basis_type=
"NUC_SOFT")
3564 cpabort(
"write_qs_kind requires qs_kind to be associated")
3569 END SUBROUTINE write_qs_kind
3579 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
3582 CHARACTER(len=*),
PARAMETER :: routinen =
'write_qs_kind_set'
3584 INTEGER :: handle, ikind, nkind, output_unit
3588 CALL timeset(routinen, handle)
3593 "PRINT%KINDS", extension=
".Log")
3594 IF (output_unit > 0)
THEN
3595 IF (
ASSOCIATED(qs_kind_set))
THEN
3596 WRITE (unit=output_unit, fmt=
"(/,/,T2,A)")
"ATOMIC KIND INFORMATION"
3597 nkind =
SIZE(qs_kind_set)
3599 qs_kind => qs_kind_set(ikind)
3600 CALL write_qs_kind(qs_kind, ikind, output_unit)
3603 cpabort(
"write_qs_kind_set requires qs_kind_set to be associated")
3610 CALL timestop(handle)
3625 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
3628 CHARACTER(LEN=*),
PARAMETER :: routinen =
'write_gto_basis_sets'
3630 CHARACTER(LEN=default_string_length) :: basis_type, bstring
3631 INTEGER :: handle, ibas, ikind, nkind, output_unit
3636 CALL timeset(routinen, handle)
3641 "PRINT%KINDS/BASIS_SET", &
3643 IF (output_unit > 0)
THEN
3644 IF (
ASSOCIATED(qs_kind_set))
THEN
3645 WRITE (unit=output_unit, fmt=
"(/,/,T2,A)") &
3646 "BASIS SET INFORMATION (Unnormalised Gaussian-type functions)"
3647 nkind =
SIZE(qs_kind_set)
3649 qs_kind => qs_kind_set(ikind)
3650 WRITE (unit=output_unit, fmt=
"(/,T2,I2,A)") &
3651 ikind,
". Atomic kind: "//trim(qs_kind%name)
3653 DO ibas = 1,
SIZE(qs_kind%basis_sets, 1)
3656 inumbas=ibas, basis_type=basis_type)
3657 IF (basis_type ==
"") cycle
3658 SELECT CASE (basis_type)
3660 bstring =
"Basis Set"
3662 bstring =
"Orbital Basis Set"
3664 bstring =
"GAPW Soft Basis Set"
3666 bstring =
"Auxiliary Basis Set"
3668 bstring =
"Minimal Basis Set"
3670 bstring =
"RI Auxiliary Basis Set"
3672 bstring =
"Auxiliary Fit Basis Set"
3674 bstring =
"LRI Basis Set"
3676 bstring =
"LRI Basis Set for TDDFPT"
3678 bstring =
"RI HFX Basis Set"
3680 bstring =
"Nuclear Basis Set"
3681 IF (.NOT.
ASSOCIATED(qs_kind%cneo_potential))
NULLIFY (tmp_basis)
3683 bstring =
"Nuclear Soft Basis Set"
3684 IF (.NOT.
ASSOCIATED(qs_kind%cneo_potential))
NULLIFY (tmp_basis)
3693 cpabort(
"write_gto_basis_sets require qs_kind_set to be associated")
3698 "PRINT%KINDS/BASIS_SET")
3700 CALL timestop(handle)
3718 INTEGER,
DIMENSION(0:lmat, 10),
INTENT(OUT) :: ncalc, ncore,
nelem
3719 REAL(kind=
dp),
DIMENSION(0:lmat, 10, 2), &
3720 INTENT(OUT) :: edelta
3721 LOGICAL,
INTENT(IN),
OPTIONAL :: rks
3723 INTEGER :: i, ii, is, l, ll, ne, nn, z
3724 INTEGER,
DIMENSION(:),
POINTER :: econf
3725 INTEGER,
DIMENSION(:, :),
POINTER :: addel, laddel, naddel
3726 LOGICAL :: bs_occupation, monovalent
3727 REAL(kind=
dp) :: dmag, magnetization
3732 NULLIFY (gth_potential)
3734 gth_potential=gth_potential, &
3735 sgp_potential=sgp_potential, &
3736 magnetization=magnetization, &
3737 bs_occupation=bs_occupation, &
3738 monovalent=monovalent, &
3739 addel=addel, laddel=laddel, naddel=naddel)
3741 IF (
PRESENT(rks))
THEN
3743 magnetization = 0.0_dp
3744 bs_occupation = .false.
3753 IF (monovalent)
THEN
3756 ELSE IF (
ASSOCIATED(gth_potential))
THEN
3759 ELSE IF (
ASSOCIATED(sgp_potential))
THEN
3763 DO l = 0, min(
lmat, ubound(
ptable(z)%e_conv, 1))
3778 ncalc =
nelem - ncore
3784 IF (bs_occupation)
THEN
3786 DO i = 1,
SIZE(addel, 1)
3789 nn = naddel(i, is) - l
3792 DO ii =
SIZE(
nelem, 2), 1, -1
3793 IF (ncalc(l, ii) > 0)
THEN
3794 IF ((ncalc(l, ii) + ne) < 2*(2*l + 1) + 1)
THEN
3795 edelta(l, ii, is) = edelta(l, ii, is) + ne
3798 edelta(l, ii + 1, is) = edelta(l, ii + 1, is) + ne
3802 ELSE IF (ii == 1)
THEN
3803 edelta(l, ii, is) = edelta(l, ii, is) + ne
3808 edelta(l, nn, is) = edelta(l, nn, is) + ne
3810 IF (ncalc(l, nn) + edelta(l, nn, is) < 0)
THEN
3811 edelta(l, nn, is) = -ncalc(l, nn)
3816 edelta = 0.5_dp*edelta
3817 ELSE IF (magnetization /= 0.0_dp)
THEN
3818 dmag = 0.5_dp*abs(magnetization)
3819 DO l = 0, min(
lmat, ubound(
ptable(z)%e_conv, 1))
3822 DO i = 1,
SIZE(ncalc, 2)
3823 IF (ncalc(l, i) == 0) cycle
3824 IF (ncalc(l, i) == ll) cycle
3825 IF (ncalc(l, i) > dmag .AND. (ll - ncalc(l, i)) > dmag)
THEN
3831 edelta(l, ii, 1) = magnetization*0.5_dp
3832 edelta(l, ii, 2) = -magnetization*0.5_dp
3837 CALL cp_abort(__location__, &
3838 "Magnetization value cannot be imposed for this atom type")
3842 IF (qs_kind%ghost .OR. qs_kind%floating)
THEN
3860 INTEGER,
DIMENSION(:),
POINTER :: econf
3861 INTEGER,
INTENT(IN) :: z
3862 INTEGER,
DIMENSION(0:lmat, 10),
INTENT(OUT) :: ncalc, ncore,
nelem
3864 CHARACTER(LEN=default_string_length) :: message
3865 INTEGER :: ii, iounit, l, ll, lmin, nc, nn
3866 INTEGER,
DIMENSION(0:lmat) :: econfx
3874 econfx(0:
SIZE(econf) - 1) = econf
3875 IF (sum(econf) >= 0)
THEN
3876 lmin = min(
lmat, ubound(
ptable(z)%e_conv, 1))
4187 IF (z == 65 .AND. econfx(3) == 0)
THEN
4193 IF (ncore(0, 1) <= 0)
THEN
4194 IF (z >= 58 .AND. z <= 71)
THEN
4207 ncore(3, 1) = nc - 28
4208 message =
"A small-core pseudopotential with 4f-in-core is used for the lanthanide "// &
4210 cphint(trim(message))
4221 ncore(3, 1) = nc - 46
4222 message =
"A medium-core pseudopotential with 4f-in-core is used for the lanthanide "// &
4224 cphint(trim(message))
4231 IF (ncore(0, 1) >= 0)
THEN
4234 nn = sum(ncore(l, :)) + econfx(l)
4247 ncalc =
nelem - ncore
4250 IF (iounit > 0)
THEN
4251 WRITE (iounit,
"(/,A,A2)")
"WARNING: Core states irregular for atom type ",
ptable(z)%symbol
4252 WRITE (iounit,
"(A,10I3)")
"WARNING: Redefine ELEC_CONF in the KIND section"
4253 cpabort(
"Incompatible Atomic Occupations Detected")
4257 lmin = min(
lmat, ubound(
ptable(z)%e_conv, 1))
4291 LOGICAL :: nlcc_present
4297 DO ikind = 1,
SIZE(qs_kind_set)
4298 CALL get_qs_kind(qs_kind_set(ikind), gth_potential=gth_potential, sgp_potential=sgp_potential)
4299 IF (
ASSOCIATED(gth_potential))
THEN
4300 CALL get_potential(potential=gth_potential, nlcc_present=nlcc_present)
4301 nlcc = nlcc .OR. nlcc_present
4302 ELSE IF (
ASSOCIATED(sgp_potential))
THEN
4304 nlcc = nlcc .OR. nlcc_present
static int imax(int x, int y)
Returns the larger of two given integers (missing from the C standard)
subroutine, public atom_sgp_release(sgp_pot)
...
subroutine, public sgp_construction(sgp_pot, ecp_pot, upf_pot, orb_basis, error)
...
Define the atom type and its sub types.
integer, parameter, public lmat
Routines that process Quantum Espresso UPF files.
subroutine, public atom_read_upf(pot, upf_filename, read_header)
...
pure subroutine, public atom_release_upf(upfpot)
...
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.
subroutine, public remove_basis_set_container(basis)
...
subroutine, public remove_basis_from_container(container, inum, basis_type)
...
subroutine, public get_basis_from_container(container, basis_set, inumbas, basis_type)
Retrieve a basis set from the container.
subroutine, public add_basis_set_to_container(container, basis_set, basis_set_type)
...
subroutine, public get_gto_basis_set(gto_basis_set, name, aliases, norm_type, kind_radius, ncgf, nset, nsgf, cgf_symbol, sgf_symbol, norm_cgf, set_radius, lmax, lmin, lx, ly, lz, m, ncgf_set, npgf, nsgf_set, nshell, cphi, pgf_radius, sphi, scon, zet, first_cgf, first_sgf, l, last_cgf, last_sgf, n, gcc, maxco, maxl, maxpgf, maxsgf_set, maxshell, maxso, nco_sum, npgf_sum, nshell_sum, maxder, short_kind_radius, npgf_seg_sum, ccon)
...
subroutine, public write_orb_basis_set(orb_basis_set, output_unit, header)
Write a Gaussian-type orbital (GTO) basis set data set to the output unit.
subroutine, public deallocate_sto_basis_set(sto_basis_set)
...
subroutine, public init_aux_basis_set(gto_basis_set)
...
subroutine, public allocate_gto_basis_set(gto_basis_set)
...
subroutine, public combine_basis_sets(basis_set, basis_set_add)
...
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.
subroutine, public allocate_sto_basis_set(sto_basis_set)
...
subroutine, public create_gto_from_sto_basis(sto_basis_set, gto_basis_set, ngauss, ortho)
...
subroutine, public read_sto_basis_set(element_symbol, basis_set_name, sto_basis_set, para_env, dft_section)
...
subroutine, public init_orb_basis_set(gto_basis_set)
Initialise a Gaussian-type orbital (GTO) basis set data set.
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 ...
integer function, public cp_logger_get_default_io_unit(logger)
returns the unit nr for the ionode (-1 on all other processors) skips as well checks if the procs cal...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
integer, parameter, public cp_p_file
integer function, public cp_print_key_should_output(iteration_info, basis_section, print_key_path, used_print_key, first_time)
returns what should be done with the given property if btest(res,cp_p_store) then the property should...
Add the DFT+U contribution to the Hamiltonian matrix.
Definition of the atomic potential types.
subroutine, public set_default_all_potential(potential, z, zeff_correction)
...
subroutine, public create_1c_basis(orb_basis, soft_basis, gapw_1c_basis, basis_1c_level)
create the one center basis from the orbital basis
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
integer, parameter, public default_path_length
Definition of mathematical constants and functions.
real(kind=dp), parameter, public pi
Interface to the message passing library MPI.
Provides Cartesian and spherical orbital pointers and indices.
subroutine, public init_orbital_pointers(maxl)
Initialize or update the orbital pointers.
integer, dimension(:), allocatable, public nco
integer, dimension(:), allocatable, public ncoset
Factory routines for potentials used e.g. by pao_param_exp and pao_ml.
subroutine, public get_paw_proj_set(paw_proj_set, csprj, chprj, first_prj, first_prjs, last_prj, local_oce_sphi_h, local_oce_sphi_s, maxl, ncgauprj, nsgauprj, nsatbas, nsotot, nprj, o2nindex, n2oindex, rcprj, rzetprj, zisomin, zetprj)
Get informations about a paw projectors set.
subroutine, public allocate_paw_proj_set(paw_proj_set)
Allocate projector type for GAPW.
subroutine, public projectors(paw_proj, basis_1c, orb_basis, rc, qs_control, max_rad_local_type, force_env_section)
Initialize the projector-type set data set.
subroutine, public deallocate_paw_proj_set(paw_proj_set)
Deallocate a projector-type set data set.
Periodic Table related data definitions.
type(atom), dimension(0:nelem), public ptable
integer, parameter, public nelem
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:
real(kind=dp), parameter, public evolt
real(kind=dp), parameter, public angstrom
real(kind=dp), parameter, public bohr
Types used by CNEO-DFT (see J. Chem. Theory Comput. 2025, 21, 16, 7865–7877)
subroutine, public allocate_cneo_potential(potential)
...
subroutine, public write_cneo_potential(potential, output_unit)
...
subroutine, public deallocate_cneo_potential(potential)
...
subroutine, public set_cneo_potential(potential, z, mass, elec_conf, nsgf, nne, npsgf, nsotot, my_gcc_h, my_gcc_s, ovlp, kin, utrans, distance, harmonics, qlm_gg, gg, vgg, n2oindex, o2nindex, rad2l, oorad2l)
...
subroutine, public get_cneo_potential(potential, z, zeff, mass, elec_conf, nsgf, nne, npsgf, nsotot, my_gcc_h, my_gcc_s, ovlp, kin, utrans, distance, harmonics, qlm_gg, gg, vgg, n2oindex, o2nindex, rad2l, oorad2l)
...
Definition of the DFTB parameter types.
Working with the DFTB parameter types.
subroutine, public deallocate_dftb_atom_param(dftb_parameter)
...
subroutine, public write_dftb_atom_param(dftb_parameter, subsys_section)
...
subroutine, public get_dftb_atom_param(dftb_parameter, name, typ, defined, z, zeff, natorb, lmax, skself, occupation, eta, energy, cutoff, xi, di, rcdisp, dudq)
...
Definition of disperson types for DFT calculations.
subroutine, public deallocate_grid_atom(grid_atom)
Deallocate a Gaussian-type orbital (GTO) basis set data set.
subroutine, public allocate_grid_atom(grid_atom)
Initialize components of the grid_atom_type structure.
subroutine, public allocate_harmonics_atom(harmonics)
Allocate a spherical harmonics set for the atom grid.
subroutine, public deallocate_harmonics_atom(harmonics)
Deallocate the spherical harmonics set for the atom grid.
Define the quickstep kind type and their sub types.
subroutine, public set_pseudo_state(econf, z, ncalc, ncore, nelem)
...
logical function, public has_nlcc(qs_kind_set)
finds if a given qs run needs to use nlcc
subroutine, public deallocate_qs_kind_set(qs_kind_set)
Destructor routine for a set of qs kinds.
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 init_atom_electronic_state(atomic_kind, qs_kind, ncalc, ncore, nelem, edelta, rks)
...
subroutine, public init_gapw_nlcc(qs_kind_set)
...
subroutine, public init_cneo_basis_set(qs_kind_set, qs_control)
...
subroutine, public write_qs_kind_set(qs_kind_set, subsys_section)
Write an atomic kind set data set to the output unit.
subroutine, public init_gapw_basis_set(qs_kind_set, qs_control, force_env_section, modify_qs_control)
...
subroutine, public init_qs_kind_set(qs_kind_set)
Initialise an atomic kind set data set.
subroutine, public set_qs_kind(qs_kind, paw_atom, ghost, floating, hard_radius, hard0_radius, covalent_radius, vdw_radius, lmax_rho0, zeff, no_optimize, dispersion, u_minus_j, hund_j, reltmat, dftb_parameter, xtb_parameter, elec_conf, pao_basis_size)
Set the components of an atomic kind data set.
subroutine, public check_qs_kind_set(qs_kind_set, dft_control, subsys_section)
...
subroutine, public write_gto_basis_sets(qs_kind_set, subsys_section)
Write all the GTO basis sets of an atomic kind set to the output unit (for the printing of the unnorm...
subroutine, public create_qs_kind_set(qs_kind_set, atomic_kind_set, kind_section, para_env, force_env_section, silent)
Read an atomic kind set data set from the input file.
subroutine, public get_qs_kind_set(qs_kind_set, all_potential_present, tnadd_potential_present, gth_potential_present, sgp_potential_present, paw_atom_present, dft_plus_u_atom_present, maxcgf, maxsgf, maxco, maxco_proj, maxgtops, maxlgto, maxlprj, maxnset, maxsgf_set, ncgf, npgf, nset, nsgf, nshell, maxpol, maxlppl, maxlppnl, maxppnl, nelectron, maxder, max_ngrid_rad, max_sph_harm, maxg_iso_not0, lmax_rho0, basis_rcut, do_mtlr_present, basis_type, total_zeff_corr, npgf_seg, cneo_potential_present, nkind_q, natom_q)
Get attributes of an atomic kind set.
Definition of the semi empirical parameter types.
subroutine, public write_se_param(sep, subsys_section)
Writes the semi-empirical type.
subroutine, public semi_empirical_create(sep)
Allocate semi-empirical type.
subroutine, public get_se_param(sep, name, typ, defined, z, zeff, natorb, eheat, beta, sto_exponents, uss, upp, udd, uff, alp, eisol, gss, gsp, gpp, gp2, acoul, nr, de, ass, asp, app, hsp, gsd, gpd, gdd, ppddg, dpddg, ngauss)
Get info from the semi-empirical type.
subroutine, public semi_empirical_release(sep)
Deallocate the semi-empirical type.
Working with the semi empirical parameter types.
subroutine, public se_param_set_default(sep, z, method)
Initialize parameter for a semi_empirival type.
subroutine, public init_se_param(sep, orb_basis_set, ngauss)
Initialize semi_empirical type.
subroutine, public create_soft_basis(orb_basis, soft_basis, eps_fit, rc, paw_atom, paw_type_forced, gpw_r3d_rs_type_forced)
create the soft basis from a GTO basis
Utilities for string manipulations.
elemental subroutine, public uppercase(string)
Convert all lower case characters in a string to upper case.
real(kind=dp) function, public xtb_set_kab(za, zb, xtb_control)
...
Definition of the xTB parameter types.
subroutine, public deallocate_xtb_atom_param(xtb_parameter)
...
subroutine, public write_xtb_atom_param(xtb_parameter, gfn_type, subsys_section)
...
subroutine, public get_xtb_atom_param(xtb_parameter, symbol, aname, typ, defined, z, zeff, natorb, lmax, nao, lao, rcut, rcov, kx, eta, xgamma, alpha, zneff, nshell, nval, lval, kpoly, kappa, wall, hen, zeta, xi, kappa0, alpg, occupation, electronegativity, chmax, en, kqat2, kcn, kq)
...
Provides all information about an atomic kind.
type of a logger, at the moment it contains just a print level starting at which level it should be l...
stores all the informations relevant to an mpi environment
Holds information about a PAO descriptor.
Holds information about a PAO potential.
Provides all information about a quickstep kind.