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
202 TYPE(atom_upfpot_type),
POINTER :: upf_potential => null()
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 =
""
279 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
281 INTEGER :: ikind, nkind
283 IF (
ASSOCIATED(qs_kind_set))
THEN
285 nkind =
SIZE(qs_kind_set)
288 IF (
ASSOCIATED(qs_kind_set(ikind)%all_potential))
THEN
291 IF (
ASSOCIATED(qs_kind_set(ikind)%tnadd_potential))
THEN
294 IF (
ASSOCIATED(qs_kind_set(ikind)%gth_potential))
THEN
297 IF (
ASSOCIATED(qs_kind_set(ikind)%sgp_potential))
THEN
300 IF (
ASSOCIATED(qs_kind_set(ikind)%upf_potential))
THEN
302 DEALLOCATE (qs_kind_set(ikind)%upf_potential)
304 IF (
ASSOCIATED(qs_kind_set(ikind)%cneo_potential))
THEN
307 IF (
ASSOCIATED(qs_kind_set(ikind)%se_parameter))
THEN
310 IF (
ASSOCIATED(qs_kind_set(ikind)%dftb_parameter))
THEN
313 IF (
ASSOCIATED(qs_kind_set(ikind)%xtb_parameter))
THEN
316 IF (
ASSOCIATED(qs_kind_set(ikind)%paw_proj_set))
THEN
319 IF (
ASSOCIATED(qs_kind_set(ikind)%harmonics))
THEN
322 IF (
ASSOCIATED(qs_kind_set(ikind)%grid_atom))
THEN
325 IF (
ASSOCIATED(qs_kind_set(ikind)%elec_conf))
THEN
326 DEALLOCATE (qs_kind_set(ikind)%elec_conf)
329 IF (
ASSOCIATED(qs_kind_set(ikind)%dft_plus_u))
THEN
330 IF (
ASSOCIATED(qs_kind_set(ikind)%dft_plus_u%orbitals))
THEN
331 DEALLOCATE (qs_kind_set(ikind)%dft_plus_u%orbitals)
333 IF (
ASSOCIATED(qs_kind_set(ikind)%dft_plus_u%nelec))
THEN
334 DEALLOCATE (qs_kind_set(ikind)%dft_plus_u%nelec)
336 IF (
ASSOCIATED(qs_kind_set(ikind)%dft_plus_u%ao_coef))
THEN
337 DEALLOCATE (qs_kind_set(ikind)%dft_plus_u%ao_coef)
339 DEALLOCATE (qs_kind_set(ikind)%dft_plus_u)
342 IF (
ASSOCIATED(qs_kind_set(ikind)%nlcc_pot))
THEN
343 DEALLOCATE (qs_kind_set(ikind)%nlcc_pot)
346 IF (
ASSOCIATED(qs_kind_set(ikind)%dispersion))
THEN
347 DEALLOCATE (qs_kind_set(ikind)%dispersion)
349 IF (
ASSOCIATED(qs_kind_set(ikind)%addel))
THEN
350 DEALLOCATE (qs_kind_set(ikind)%addel)
352 IF (
ASSOCIATED(qs_kind_set(ikind)%naddel))
THEN
353 DEALLOCATE (qs_kind_set(ikind)%naddel)
355 IF (
ASSOCIATED(qs_kind_set(ikind)%laddel))
THEN
356 DEALLOCATE (qs_kind_set(ikind)%laddel)
358 IF (
ASSOCIATED(qs_kind_set(ikind)%reltmat))
THEN
359 DEALLOCATE (qs_kind_set(ikind)%reltmat)
362 IF (
ASSOCIATED(qs_kind_set(ikind)%pao_potentials))
THEN
363 DEALLOCATE (qs_kind_set(ikind)%pao_potentials)
365 IF (
ASSOCIATED(qs_kind_set(ikind)%pao_descriptors))
THEN
366 DEALLOCATE (qs_kind_set(ikind)%pao_descriptors)
372 DEALLOCATE (qs_kind_set)
374 CALL cp_abort(__location__, &
375 "The pointer qs_kind_set is not associated and "// &
376 "cannot be deallocated")
466 basis_set, basis_type, ncgf, nsgf, &
467 all_potential, tnadd_potential, gth_potential, sgp_potential, upf_potential, &
468 cneo_potential, se_parameter, dftb_parameter, xtb_parameter, &
469 dftb3_param, zatom, zeff, elec_conf, mao, lmax_dftb, &
470 alpha_core_charge, ccore_charge, core_charge, core_charge_radius, &
471 paw_proj_set, paw_atom, hard_radius, hard0_radius, max_rad_local, &
472 covalent_radius, vdw_radius, &
473 gpw_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, &
474 ngrid_ang, ngrid_rad, lmax_rho0, &
475 dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, &
476 u_minus_j, hund_j, U_of_dft_plus_u, J_of_dft_plus_u, &
477 alpha_of_dft_plus_u, beta_of_dft_plus_u, J0_of_dft_plus_u, occupation_of_dft_plus_u, dispersion, &
478 bs_occupation, magnetization, no_optimize, addel, laddel, naddel, orbitals, &
479 max_scf, eps_scf, smear, u_ramping, u_minus_j_target, eps_u_ramping, proj_shell_charge, &
480 lr_atom, do_mtlr, u_j_loop, ao_coef, &
481 init_u_ramping_each_scf, reltmat, ghost, monovalent, floating, name, element_symbol, &
482 pao_basis_size, pao_model_file, pao_potentials, pao_descriptors, nelec)
486 CHARACTER(len=*),
OPTIONAL :: basis_type
487 INTEGER,
INTENT(OUT),
OPTIONAL :: ncgf, nsgf
492 TYPE(atom_upfpot_type),
OPTIONAL,
POINTER :: upf_potential
497 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: dftb3_param
498 INTEGER,
INTENT(OUT),
OPTIONAL :: zatom
499 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: zeff
500 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: elec_conf
501 INTEGER,
INTENT(OUT),
OPTIONAL :: mao, lmax_dftb
502 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: alpha_core_charge, ccore_charge, &
503 core_charge, core_charge_radius
505 LOGICAL,
INTENT(OUT),
OPTIONAL :: paw_atom
506 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: hard_radius, hard0_radius, &
507 max_rad_local, covalent_radius, &
509 LOGICAL,
INTENT(OUT),
OPTIONAL :: gpw_type_forced
511 INTEGER,
INTENT(OUT),
OPTIONAL :: max_iso_not0, max_s_harm
513 INTEGER,
INTENT(OUT),
OPTIONAL :: ngrid_ang, ngrid_rad, lmax_rho0
514 LOGICAL,
INTENT(OUT),
OPTIONAL :: dft_plus_u_atom
515 INTEGER,
INTENT(OUT),
OPTIONAL :: l_of_dft_plus_u, n_of_dft_plus_u
516 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: u_minus_j, hund_j, u_of_dft_plus_u, j_of_dft_plus_u, &
517 alpha_of_dft_plus_u, beta_of_dft_plus_u, j0_of_dft_plus_u, occupation_of_dft_plus_u
519 LOGICAL,
INTENT(OUT),
OPTIONAL :: bs_occupation
520 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: magnetization
521 LOGICAL,
INTENT(OUT),
OPTIONAL :: no_optimize
522 INTEGER,
DIMENSION(:, :),
OPTIONAL,
POINTER :: addel, laddel, naddel
523 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: orbitals
524 INTEGER,
OPTIONAL :: max_scf
525 REAL(kind=
dp),
OPTIONAL :: eps_scf
526 LOGICAL,
OPTIONAL :: smear
527 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: u_ramping, u_minus_j_target, &
528 eps_u_ramping, proj_shell_charge(4)
529 INTEGER,
OPTIONAL :: lr_atom
530 LOGICAL,
INTENT(OUT),
OPTIONAL :: do_mtlr, u_j_loop
531 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: ao_coef
532 LOGICAL,
OPTIONAL :: init_u_ramping_each_scf
533 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: reltmat
534 LOGICAL,
OPTIONAL :: ghost
535 LOGICAL,
INTENT(OUT),
OPTIONAL :: monovalent
536 LOGICAL,
OPTIONAL :: floating
537 CHARACTER(LEN=default_string_length), &
538 INTENT(OUT),
OPTIONAL :: name
539 CHARACTER(LEN=2),
INTENT(OUT),
OPTIONAL :: element_symbol
540 INTEGER,
INTENT(OUT),
OPTIONAL :: pao_basis_size
541 CHARACTER(LEN=default_path_length),
INTENT(OUT), &
542 OPTIONAL :: pao_model_file
546 OPTIONAL,
POINTER :: pao_descriptors
547 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: nelec
549 CHARACTER(LEN=default_string_length) :: my_basis_type
555 IF (
PRESENT(basis_type))
THEN
556 my_basis_type = basis_type
558 my_basis_type =
"ORB"
561 IF (
PRESENT(basis_set))
THEN
563 basis_type=my_basis_type)
566 IF (
PRESENT(ncgf))
THEN
568 basis_type=my_basis_type)
569 IF (
ASSOCIATED(tmp_basis_set))
THEN
571 ELSE IF (
ASSOCIATED(qs_kind%dftb_parameter))
THEN
572 l = qs_kind%dftb_parameter%lmax
573 ncgf = ((l + 1)*(l + 2)*(l + 3))/6
579 IF (
PRESENT(nsgf))
THEN
581 basis_type=my_basis_type)
582 IF (
ASSOCIATED(tmp_basis_set))
THEN
584 ELSE IF (
ASSOCIATED(qs_kind%dftb_parameter))
THEN
585 nsgf = qs_kind%dftb_parameter%natorb
591 IF (
PRESENT(all_potential)) all_potential => qs_kind%all_potential
592 IF (
PRESENT(tnadd_potential)) tnadd_potential => qs_kind%tnadd_potential
593 IF (
PRESENT(gth_potential)) gth_potential => qs_kind%gth_potential
594 IF (
PRESENT(sgp_potential)) sgp_potential => qs_kind%sgp_potential
595 IF (
PRESENT(upf_potential)) upf_potential => qs_kind%upf_potential
596 IF (
PRESENT(cneo_potential)) cneo_potential => qs_kind%cneo_potential
597 IF (
PRESENT(se_parameter)) se_parameter => qs_kind%se_parameter
598 IF (
PRESENT(dftb_parameter)) dftb_parameter => qs_kind%dftb_parameter
599 IF (
PRESENT(xtb_parameter)) xtb_parameter => qs_kind%xtb_parameter
600 IF (
PRESENT(element_symbol)) element_symbol = qs_kind%element_symbol
601 IF (
PRESENT(name)) name = qs_kind%name
602 IF (
PRESENT(dftb3_param)) dftb3_param = qs_kind%dudq_dftb3
603 IF (
PRESENT(elec_conf)) elec_conf => qs_kind%elec_conf
604 IF (
PRESENT(alpha_core_charge))
THEN
605 IF (
ASSOCIATED(qs_kind%all_potential))
THEN
607 alpha_core_charge=alpha_core_charge)
608 ELSE IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
610 alpha_core_charge=alpha_core_charge)
611 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
613 alpha_core_charge=alpha_core_charge)
614 ELSE IF (
ASSOCIATED(qs_kind%cneo_potential))
THEN
615 cpabort(
"CNEO ALPHA CORE CHARGE NOT AVAILABLE")
617 alpha_core_charge = 1.0_dp
620 IF (
PRESENT(ccore_charge))
THEN
621 IF (
ASSOCIATED(qs_kind%all_potential))
THEN
623 ccore_charge=ccore_charge)
624 ELSE IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
626 ccore_charge=ccore_charge)
627 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
629 ccore_charge=ccore_charge)
630 ELSE IF (
ASSOCIATED(qs_kind%upf_potential))
THEN
631 cpabort(
"UPF CCORE CHARGE NOT AVAILABLE")
632 ELSE IF (
ASSOCIATED(qs_kind%cneo_potential))
THEN
633 cpabort(
"CNEO CCORE CHARGE NOT AVAILABLE")
635 ccore_charge = 0.0_dp
638 IF (
PRESENT(core_charge_radius))
THEN
639 IF (
ASSOCIATED(qs_kind%all_potential))
THEN
641 core_charge_radius=core_charge_radius)
642 ELSE IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
644 core_charge_radius=core_charge_radius)
645 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
647 core_charge_radius=core_charge_radius)
648 ELSE IF (
ASSOCIATED(qs_kind%upf_potential))
THEN
649 cpabort(
"UPF CORE CHARGE RADIUS NOT AVAILABLE")
650 ELSE IF (
ASSOCIATED(qs_kind%cneo_potential))
THEN
651 cpabort(
"CNEO CORE CHARGE RADIUS NOT AVAILABLE")
653 core_charge_radius = 0.0_dp
656 IF (
PRESENT(core_charge))
THEN
657 IF (
ASSOCIATED(qs_kind%all_potential))
THEN
660 ELSE IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
663 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
666 ELSE IF (
ASSOCIATED(qs_kind%upf_potential))
THEN
667 cpabort(
"UPF CORE CHARGE NOT AVAILABLE")
668 ELSE IF (
ASSOCIATED(qs_kind%cneo_potential))
THEN
676 IF (
PRESENT(zatom))
THEN
678 CALL get_ptable_info(qs_kind%element_symbol, ielement=zatom, found=found)
682 IF (
PRESENT(zeff))
THEN
683 IF (
ASSOCIATED(qs_kind%all_potential))
THEN
684 CALL get_potential(potential=qs_kind%all_potential, zeff=zeff)
685 ELSE IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
686 CALL get_potential(potential=qs_kind%gth_potential, zeff=zeff)
687 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
688 CALL get_potential(potential=qs_kind%sgp_potential, zeff=zeff)
689 ELSE IF (
ASSOCIATED(qs_kind%upf_potential))
THEN
690 zeff = qs_kind%upf_potential%zion
691 ELSE IF (
ASSOCIATED(qs_kind%cneo_potential))
THEN
698 IF (
PRESENT(covalent_radius)) covalent_radius = qs_kind%covalent_radius
699 IF (
PRESENT(vdw_radius)) vdw_radius = qs_kind%vdw_radius
701 IF (
PRESENT(paw_proj_set)) paw_proj_set => qs_kind%paw_proj_set
702 IF (
PRESENT(paw_atom)) paw_atom = qs_kind%paw_atom
703 IF (
PRESENT(gpw_type_forced)) gpw_type_forced = qs_kind%gpw_type_forced
704 IF (
PRESENT(hard_radius)) hard_radius = qs_kind%hard_radius
705 IF (
PRESENT(hard0_radius)) hard0_radius = qs_kind%hard0_radius
706 IF (
PRESENT(max_rad_local)) max_rad_local = qs_kind%max_rad_local
707 IF (
PRESENT(harmonics)) harmonics => qs_kind%harmonics
708 IF (
PRESENT(max_s_harm))
THEN
709 IF (
ASSOCIATED(qs_kind%harmonics))
THEN
710 max_s_harm = qs_kind%harmonics%max_s_harm
715 IF (
PRESENT(max_iso_not0))
THEN
716 IF (
ASSOCIATED(qs_kind%harmonics))
THEN
717 max_iso_not0 = qs_kind%harmonics%max_iso_not0
722 IF (
PRESENT(grid_atom)) grid_atom => qs_kind%grid_atom
723 IF (
PRESENT(ngrid_ang)) ngrid_ang = qs_kind%ngrid_ang
724 IF (
PRESENT(ngrid_rad)) ngrid_rad = qs_kind%ngrid_rad
725 IF (
PRESENT(lmax_rho0)) lmax_rho0 = qs_kind%lmax_rho0
726 IF (
PRESENT(ghost)) ghost = qs_kind%ghost
727 IF (
PRESENT(monovalent)) monovalent = qs_kind%monovalent
728 IF (
PRESENT(floating)) floating = qs_kind%floating
729 IF (
PRESENT(dft_plus_u_atom)) dft_plus_u_atom =
ASSOCIATED(qs_kind%dft_plus_u)
730 IF (
PRESENT(do_mtlr))
THEN
731 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
732 do_mtlr = qs_kind%dft_plus_u%do_mtlr
737 IF (
PRESENT(l_of_dft_plus_u))
THEN
738 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
739 l_of_dft_plus_u = qs_kind%dft_plus_u%l
744 IF (
PRESENT(n_of_dft_plus_u))
THEN
745 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
746 n_of_dft_plus_u = qs_kind%dft_plus_u%n
751 IF (
PRESENT(u_minus_j))
THEN
752 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
753 u_minus_j = qs_kind%dft_plus_u%u_minus_j
758 IF (
PRESENT(u_minus_j_target))
THEN
759 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
760 u_minus_j_target = qs_kind%dft_plus_u%u_minus_j_target
762 u_minus_j_target = 0.0_dp
765 IF (
PRESENT(hund_j))
THEN
766 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
767 hund_j = qs_kind%dft_plus_u%hund_j
772 IF (
PRESENT(u_of_dft_plus_u))
THEN
773 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
774 u_of_dft_plus_u = qs_kind%dft_plus_u%U
776 u_of_dft_plus_u = 0.0_dp
779 IF (
PRESENT(j_of_dft_plus_u))
THEN
780 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
781 j_of_dft_plus_u = qs_kind%dft_plus_u%J
783 j_of_dft_plus_u = 0.0_dp
786 IF (
PRESENT(alpha_of_dft_plus_u))
THEN
787 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
788 alpha_of_dft_plus_u = qs_kind%dft_plus_u%alpha
790 alpha_of_dft_plus_u = 0.0_dp
793 IF (
PRESENT(beta_of_dft_plus_u))
THEN
794 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
795 beta_of_dft_plus_u = qs_kind%dft_plus_u%beta
797 beta_of_dft_plus_u = 0.0_dp
800 IF (
PRESENT(j0_of_dft_plus_u))
THEN
801 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
802 j0_of_dft_plus_u = qs_kind%dft_plus_u%J0
804 j0_of_dft_plus_u = 0.0_dp
807 IF (
PRESENT(occupation_of_dft_plus_u))
THEN
808 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
809 occupation_of_dft_plus_u = qs_kind%dft_plus_u%occupation
811 occupation_of_dft_plus_u = -1.0_dp
815 IF (
PRESENT(init_u_ramping_each_scf))
THEN
816 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
817 init_u_ramping_each_scf = qs_kind%dft_plus_u%init_u_ramping_each_scf
819 init_u_ramping_each_scf = .false.
822 IF (
PRESENT(u_ramping))
THEN
823 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
824 u_ramping = qs_kind%dft_plus_u%u_ramping
829 IF (
PRESENT(eps_u_ramping))
THEN
830 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
831 eps_u_ramping = qs_kind%dft_plus_u%eps_u_ramping
833 eps_u_ramping = 1.0e-5_dp
836 IF (
PRESENT(lr_atom))
THEN
837 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
838 lr_atom = qs_kind%dft_plus_u%lr_atom
843 IF (
PRESENT(u_j_loop))
THEN
844 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
845 u_j_loop = qs_kind%dft_plus_u%u_j_loop
850 IF (
PRESENT(proj_shell_charge))
THEN
851 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
852 proj_shell_charge = qs_kind%dft_plus_u%proj_shell_charge
854 proj_shell_charge = 0.0_dp
857 IF (
PRESENT(nelec))
THEN
859 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
860 IF (
ASSOCIATED(qs_kind%dft_plus_u%nelec))
THEN
861 nelec => qs_kind%dft_plus_u%nelec
865 IF (
PRESENT(orbitals))
THEN
867 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
868 IF (
ASSOCIATED(qs_kind%dft_plus_u%orbitals))
THEN
869 orbitals => qs_kind%dft_plus_u%orbitals
873 IF (
PRESENT(eps_scf))
THEN
874 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
875 eps_scf = qs_kind%dft_plus_u%eps_scf
880 IF (
PRESENT(max_scf))
THEN
881 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
882 max_scf = qs_kind%dft_plus_u%max_scf
887 IF (
PRESENT(smear))
THEN
888 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
889 smear = qs_kind%dft_plus_u%smear
894 IF (
PRESENT(dispersion)) dispersion => qs_kind%dispersion
895 IF (
PRESENT(bs_occupation)) bs_occupation = qs_kind%bs_occupation
896 IF (
PRESENT(addel)) addel => qs_kind%addel
897 IF (
PRESENT(laddel)) laddel => qs_kind%laddel
898 IF (
PRESENT(naddel)) naddel => qs_kind%naddel
900 IF (
PRESENT(magnetization)) magnetization = qs_kind%magnetization
902 IF (
PRESENT(no_optimize)) no_optimize = qs_kind%no_optimize
904 IF (
PRESENT(reltmat)) reltmat => qs_kind%reltmat
906 IF (
PRESENT(ao_coef))
THEN
908 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
909 IF (
ASSOCIATED(qs_kind%dft_plus_u%ao_coef))
THEN
910 ao_coef => qs_kind%dft_plus_u%ao_coef
915 IF (
PRESENT(mao)) mao = qs_kind%mao
917 IF (
PRESENT(lmax_dftb)) lmax_dftb = qs_kind%lmax_dftb
919 IF (
PRESENT(pao_basis_size)) pao_basis_size = qs_kind%pao_basis_size
920 IF (
PRESENT(pao_model_file)) pao_model_file = qs_kind%pao_model_file
922 IF (
PRESENT(pao_descriptors)) pao_descriptors => qs_kind%pao_descriptors
968 all_potential_present, tnadd_potential_present, gth_potential_present, &
969 sgp_potential_present, paw_atom_present, dft_plus_u_atom_present, &
970 maxcgf, maxsgf, maxco, maxco_proj, maxgtops, maxlgto, maxlprj, maxnset, maxsgf_set, &
971 ncgf, npgf, nset, nsgf, nshell, maxpol, maxlppl, maxlppnl, maxppnl, &
972 nelectron, maxder, max_ngrid_rad, max_sph_harm, maxg_iso_not0, lmax_rho0, &
973 basis_rcut, do_mtlr_present, &
974 basis_type, total_zeff_corr, npgf_seg, &
975 cneo_potential_present, nkind_q, natom_q)
977 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
978 LOGICAL,
INTENT(OUT),
OPTIONAL :: all_potential_present, tnadd_potential_present, &
979 gth_potential_present, sgp_potential_present, paw_atom_present, dft_plus_u_atom_present
980 INTEGER,
INTENT(OUT),
OPTIONAL :: maxcgf, maxsgf, maxco, maxco_proj, maxgtops, maxlgto, &
981 maxlprj, maxnset, maxsgf_set, ncgf, npgf, nset, nsgf, nshell, maxpol, maxlppl, maxlppnl, &
983 INTEGER,
INTENT(IN),
OPTIONAL :: maxder
984 INTEGER,
INTENT(OUT),
OPTIONAL :: max_ngrid_rad, max_sph_harm, &
985 maxg_iso_not0, lmax_rho0
986 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: basis_rcut
987 LOGICAL,
INTENT(OUT),
OPTIONAL :: do_mtlr_present
988 CHARACTER(len=*),
OPTIONAL :: basis_type
989 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: total_zeff_corr
990 INTEGER,
INTENT(OUT),
OPTIONAL :: npgf_seg
991 LOGICAL,
INTENT(OUT),
OPTIONAL :: cneo_potential_present
992 INTEGER,
INTENT(OUT),
OPTIONAL :: nkind_q, natom_q
994 CHARACTER(len=default_string_length) :: my_basis_type
995 INTEGER :: ikind,
imax, lmax_rho0_kind, &
996 max_iso_not0, max_s_harm, n, &
997 ngrid_rad, nkind, nrloc(10), &
999 LOGICAL :: dft_plus_u_atom, do_mtlr, &
1000 ecp_semi_local, paw_atom
1001 REAL(kind=
dp) :: brcut, zeff, zeff_correction
1012 IF (
PRESENT(basis_type))
THEN
1013 my_basis_type = basis_type
1015 my_basis_type =
"ORB"
1018 IF (
ASSOCIATED(qs_kind_set))
THEN
1020 IF (
PRESENT(maxcgf)) maxcgf = 0
1021 IF (
PRESENT(maxco)) maxco = 0
1022 IF (
PRESENT(maxco_proj)) maxco_proj = 0
1023 IF (
PRESENT(maxg_iso_not0)) maxg_iso_not0 = 0
1024 IF (
PRESENT(maxgtops)) maxgtops = 0
1025 IF (
PRESENT(maxlgto)) maxlgto = -1
1026 IF (
PRESENT(maxlppl)) maxlppl = -1
1027 IF (
PRESENT(maxlppnl)) maxlppnl = -1
1028 IF (
PRESENT(maxpol)) maxpol = -1
1029 IF (
PRESENT(maxlprj)) maxlprj = -1
1030 IF (
PRESENT(maxnset)) maxnset = 0
1031 IF (
PRESENT(maxppnl)) maxppnl = 0
1032 IF (
PRESENT(maxsgf)) maxsgf = 0
1033 IF (
PRESENT(maxsgf_set)) maxsgf_set = 0
1034 IF (
PRESENT(ncgf)) ncgf = 0
1035 IF (
PRESENT(nelectron)) nelectron = 0
1036 IF (
PRESENT(npgf)) npgf = 0
1037 IF (
PRESENT(nset)) nset = 0
1038 IF (
PRESENT(nsgf)) nsgf = 0
1039 IF (
PRESENT(nshell)) nshell = 0
1040 IF (
PRESENT(all_potential_present)) all_potential_present = .false.
1041 IF (
PRESENT(tnadd_potential_present)) tnadd_potential_present = .false.
1042 IF (
PRESENT(gth_potential_present)) gth_potential_present = .false.
1043 IF (
PRESENT(sgp_potential_present)) sgp_potential_present = .false.
1044 IF (
PRESENT(cneo_potential_present)) cneo_potential_present = .false.
1045 IF (
PRESENT(nkind_q)) nkind_q = 0
1046 IF (
PRESENT(natom_q)) natom_q = 0
1047 IF (
PRESENT(paw_atom_present)) paw_atom_present = .false.
1048 IF (
PRESENT(max_ngrid_rad)) max_ngrid_rad = 0
1049 IF (
PRESENT(max_sph_harm)) max_sph_harm = 0
1050 IF (
PRESENT(lmax_rho0)) lmax_rho0 = 0
1051 IF (
PRESENT(basis_rcut)) basis_rcut = 0.0_dp
1052 IF (
PRESENT(total_zeff_corr)) total_zeff_corr = 0.0_dp
1053 IF (
PRESENT(npgf_seg)) npgf_seg = 0
1054 IF (
PRESENT(do_mtlr_present)) do_mtlr_present = .false.
1056 nkind =
SIZE(qs_kind_set)
1058 qs_kind => qs_kind_set(ikind)
1060 all_potential=all_potential, &
1061 tnadd_potential=tnadd_potential, &
1062 gth_potential=gth_potential, &
1063 sgp_potential=sgp_potential, &
1064 cneo_potential=cneo_potential, &
1065 paw_proj_set=paw_proj_set, &
1066 dftb_parameter=dftb_parameter, &
1067 ngrid_rad=ngrid_rad, &
1068 max_s_harm=max_s_harm, &
1069 max_iso_not0=max_iso_not0, &
1070 paw_atom=paw_atom, &
1071 dft_plus_u_atom=dft_plus_u_atom, &
1073 lmax_rho0=lmax_rho0_kind)
1075 IF (
PRESENT(maxlppl) .AND.
ASSOCIATED(gth_potential))
THEN
1077 maxlppl = max(maxlppl, 2*(n - 1))
1078 ELSE IF (
PRESENT(maxlppl) .AND.
ASSOCIATED(sgp_potential))
THEN
1079 CALL get_potential(potential=sgp_potential, nrloc=nrloc, ecp_semi_local=ecp_semi_local)
1080 n = maxval(nrloc) - 2
1081 maxlppl = max(maxlppl, 2*(n - 1))
1082 IF (ecp_semi_local)
THEN
1084 n = maxval(nrpot) - 2
1085 n = 2*(n - 1) +
imax
1086 maxlppl = max(maxlppl, n)
1090 IF (
PRESENT(maxlppnl) .AND.
ASSOCIATED(gth_potential))
THEN
1092 maxlppnl = max(maxlppnl,
imax)
1093 ELSE IF (
PRESENT(maxlppnl) .AND.
ASSOCIATED(sgp_potential))
THEN
1095 maxlppnl = max(maxlppnl,
imax)
1098 IF (
PRESENT(maxpol) .AND.
ASSOCIATED(tnadd_potential))
THEN
1100 maxpol = max(maxpol, 2*(n - 1))
1103 IF (
PRESENT(maxco_proj) .AND.
ASSOCIATED(paw_proj_set))
THEN
1105 maxco_proj = max(maxco_proj,
imax)
1108 IF (
PRESENT(maxlprj) .AND.
ASSOCIATED(paw_proj_set))
THEN
1110 maxlprj = max(maxlprj,
imax)
1113 IF (
PRESENT(maxppnl) .AND.
ASSOCIATED(gth_potential))
THEN
1115 maxppnl = max(maxppnl,
imax)
1116 ELSE IF (
PRESENT(maxppnl) .AND.
ASSOCIATED(sgp_potential))
THEN
1118 maxppnl = max(maxppnl,
imax)
1121 IF (my_basis_type(1:3) ==
"NUC" .AND. .NOT.
ASSOCIATED(cneo_potential))
THEN
1122 NULLIFY (tmp_basis_set)
1125 basis_type=my_basis_type)
1128 IF (
PRESENT(maxcgf))
THEN
1129 IF (
ASSOCIATED(tmp_basis_set))
THEN
1131 maxcgf = max(maxcgf,
imax)
1132 ELSE IF (
ASSOCIATED(qs_kind%dftb_parameter))
THEN
1135 maxcgf = max(maxcgf,
imax)
1139 IF (
PRESENT(maxco))
THEN
1140 IF (
ASSOCIATED(tmp_basis_set))
THEN
1141 IF (
PRESENT(maxder))
THEN
1143 maxco=
imax, maxder=maxder)
1147 maxco = max(maxco,
imax)
1149 IF (
ASSOCIATED(gth_potential))
THEN
1153 IF (
ASSOCIATED(sgp_potential))
THEN
1161 IF (
PRESENT(maxgtops))
THEN
1162 IF (
ASSOCIATED(tmp_basis_set))
THEN
1164 maxgtops = max(maxgtops, n*
imax)
1168 IF (
PRESENT(maxlgto))
THEN
1169 IF (
ASSOCIATED(tmp_basis_set))
THEN
1171 maxlgto = max(maxlgto,
imax)
1172 ELSE IF (
ASSOCIATED(qs_kind%dftb_parameter))
THEN
1174 maxlgto = max(maxlgto,
imax)
1178 IF (
PRESENT(maxnset))
THEN
1179 IF (
ASSOCIATED(tmp_basis_set))
THEN
1181 maxnset = max(maxnset, n)
1185 IF (
PRESENT(maxsgf))
THEN
1186 IF (
ASSOCIATED(tmp_basis_set))
THEN
1188 maxsgf = max(maxsgf,
imax)
1192 IF (
PRESENT(maxsgf_set))
THEN
1193 IF (
ASSOCIATED(tmp_basis_set))
THEN
1195 maxsgf_set = max(maxsgf_set,
imax)
1199 IF (
PRESENT(ncgf))
THEN
1200 IF (
ASSOCIATED(tmp_basis_set))
THEN
1202 ncgf = ncgf + n*qs_kind_set(ikind)%natom
1203 ELSE IF (
ASSOCIATED(qs_kind%dftb_parameter))
THEN
1206 ncgf = ncgf + n*qs_kind_set(ikind)%natom
1210 IF (
PRESENT(npgf))
THEN
1211 IF (
ASSOCIATED(tmp_basis_set))
THEN
1213 npgf = npgf + n*qs_kind_set(ikind)%natom
1217 IF (
PRESENT(nset))
THEN
1218 IF (
ASSOCIATED(tmp_basis_set))
THEN
1220 nset = nset + n*qs_kind_set(ikind)%natom
1224 IF (
PRESENT(nsgf))
THEN
1225 IF (
ASSOCIATED(tmp_basis_set))
THEN
1227 nsgf = nsgf + n*qs_kind_set(ikind)%natom
1228 ELSE IF (
ASSOCIATED(qs_kind%dftb_parameter))
THEN
1230 nsgf = nsgf + n*qs_kind_set(ikind)%natom
1234 IF (
PRESENT(nshell))
THEN
1235 IF (
ASSOCIATED(tmp_basis_set))
THEN
1237 nshell = nshell + n*qs_kind_set(ikind)%natom
1238 ELSE IF (
ASSOCIATED(qs_kind%dftb_parameter))
THEN
1240 nshell = nshell + (n + 1)*qs_kind_set(ikind)%natom
1244 IF (
PRESENT(nelectron))
THEN
1245 IF (
ASSOCIATED(qs_kind%all_potential))
THEN
1247 zeff=zeff, zeff_correction=zeff_correction)
1248 ELSE IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
1250 zeff=zeff, zeff_correction=zeff_correction)
1251 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
1253 zeff=zeff, zeff_correction=zeff_correction)
1254 ELSE IF (
ASSOCIATED(qs_kind%cneo_potential))
THEN
1257 zeff_correction = 0.0_dp
1260 zeff_correction = 0.0_dp
1262 nelectron = nelectron + qs_kind_set(ikind)%natom*nint(zeff - zeff_correction)
1265 IF (
PRESENT(basis_rcut))
THEN
1266 IF (
ASSOCIATED(tmp_basis_set))
THEN
1268 basis_rcut = max(basis_rcut, brcut)
1269 ELSE IF (
ASSOCIATED(qs_kind%dftb_parameter))
THEN
1271 basis_rcut = max(basis_rcut, brcut)
1275 IF (
PRESENT(total_zeff_corr))
THEN
1276 IF (
ASSOCIATED(qs_kind%all_potential))
THEN
1278 zeff=zeff, zeff_correction=zeff_correction)
1279 ELSE IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
1281 zeff=zeff, zeff_correction=zeff_correction)
1282 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
1284 zeff=zeff, zeff_correction=zeff_correction)
1287 zeff_correction = 0.0_dp
1289 total_zeff_corr = total_zeff_corr + qs_kind_set(ikind)%natom*zeff_correction
1292 IF (
PRESENT(all_potential_present))
THEN
1293 IF (
ASSOCIATED(all_potential))
THEN
1294 all_potential_present = .true.
1298 IF (
PRESENT(tnadd_potential_present))
THEN
1299 IF (
ASSOCIATED(tnadd_potential))
THEN
1300 tnadd_potential_present = .true.
1304 IF (
PRESENT(gth_potential_present))
THEN
1305 IF (
ASSOCIATED(gth_potential))
THEN
1306 gth_potential_present = .true.
1310 IF (
PRESENT(sgp_potential_present))
THEN
1311 IF (
ASSOCIATED(sgp_potential))
THEN
1312 sgp_potential_present = .true.
1316 IF (
PRESENT(cneo_potential_present))
THEN
1317 IF (
ASSOCIATED(cneo_potential))
THEN
1318 cneo_potential_present = .true.
1322 IF (
PRESENT(nkind_q))
THEN
1323 IF (
ASSOCIATED(cneo_potential))
THEN
1324 nkind_q = nkind_q + 1
1328 IF (
PRESENT(natom_q))
THEN
1329 IF (
ASSOCIATED(cneo_potential))
THEN
1330 natom_q = natom_q + qs_kind_set(ikind)%natom
1334 IF (
PRESENT(paw_atom_present))
THEN
1336 paw_atom_present = .true.
1340 IF (
PRESENT(dft_plus_u_atom_present))
THEN
1341 IF (dft_plus_u_atom)
THEN
1342 dft_plus_u_atom_present = .true.
1346 IF (
PRESENT(do_mtlr_present))
THEN
1348 do_mtlr_present = .true.
1352 IF (
PRESENT(max_ngrid_rad))
THEN
1353 max_ngrid_rad = max(max_ngrid_rad, ngrid_rad)
1356 IF (
PRESENT(max_sph_harm))
THEN
1357 max_sph_harm = max(max_sph_harm, max_s_harm)
1360 IF (
PRESENT(maxg_iso_not0))
THEN
1361 maxg_iso_not0 = max(maxg_iso_not0, max_iso_not0)
1364 IF (
PRESENT(lmax_rho0))
THEN
1365 lmax_rho0 = max(lmax_rho0, lmax_rho0_kind)
1368 IF (
PRESENT(npgf_seg))
THEN
1369 IF (
ASSOCIATED(tmp_basis_set))
THEN
1371 npgf_seg = npgf_seg + n*qs_kind_set(ikind)%natom
1377 cpabort(
"The pointer qs_kind_set is not associated")
1388 SUBROUTINE init_qs_kind(qs_kind)
1391 CHARACTER(len=*),
PARAMETER :: routinen =
'init_qs_kind'
1393 CHARACTER(LEN=default_string_length) :: basis_type
1394 INTEGER :: handle, i
1397 CALL timeset(routinen, handle)
1399 cpassert(
ASSOCIATED(qs_kind))
1401 IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
1403 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
1407 DO i = 1,
SIZE(qs_kind%basis_sets, 1)
1408 NULLIFY (tmp_basis_set)
1410 inumbas=i, basis_type=basis_type)
1411 IF (basis_type ==
"") cycle
1412 IF (basis_type ==
"AUX")
THEN
1413 IF (tmp_basis_set%norm_type < 0) tmp_basis_set%norm_type = 1
1416 IF (tmp_basis_set%norm_type < 0) tmp_basis_set%norm_type = 2
1421 CALL timestop(handle)
1423 END SUBROUTINE init_qs_kind
1433 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1435 CHARACTER(len=*),
PARAMETER :: routinen =
'init_qs_kind_set'
1437 INTEGER :: handle, ikind
1440 CALL timeset(routinen, handle)
1442 IF (.NOT.
ASSOCIATED(qs_kind_set))
THEN
1443 cpabort(
"init_qs_kind_set: The pointer qs_kind_set is not associated")
1446 DO ikind = 1,
SIZE(qs_kind_set)
1447 qs_kind => qs_kind_set(ikind)
1448 CALL init_qs_kind(qs_kind)
1451 CALL timestop(handle)
1460 FUNCTION skala_gapw_representation_from_input(force_env_section)
RESULT(representation)
1462 INTEGER :: representation
1464 CHARACTER(LEN=default_path_length) :: model_key, model_name
1465 CHARACTER(LEN=default_string_length) :: functional_key, functional_name
1471 IF (.NOT.
ASSOCIATED(functionals))
RETURN
1477 IF (.NOT.
ASSOCIATED(functional))
EXIT
1478 IF (functional%section%name /=
"GAUXC") cycle
1482 model_key = adjustl(model_name)
1483 functional_key = adjustl(functional_name)
1486 IF (trim(model_key) /=
"" .AND. trim(model_key) /=
"NONE" .AND. &
1487 trim(model_key) /= trim(functional_key))
THEN
1489 i_val=representation)
1494 END FUNCTION skala_gapw_representation_from_input
1505 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1508 LOGICAL,
OPTIONAL :: modify_qs_control
1510 CHARACTER(LEN=default_string_length) :: bsname
1511 INTEGER :: bas1c, ikind, ilevel, nkind, &
1513 LOGICAL :: effective_force_paw, effective_gpw, gpw, &
1514 has_pseudopotential, my_mod_control, &
1516 REAL(
dp) :: max_rad_local_type, rc
1523 my_mod_control = .true.
1524 IF (
PRESENT(modify_qs_control))
THEN
1525 my_mod_control = modify_qs_control
1527 representation = skala_gapw_representation_from_input(force_env_section)
1529 IF (
ASSOCIATED(qs_kind_set))
THEN
1531 IF (my_mod_control) qs_control%gapw_control%non_paw_atoms = .false.
1532 nkind =
SIZE(qs_kind_set)
1536 qs_kind => qs_kind_set(ikind)
1538 CALL get_qs_kind(qs_kind=qs_kind, basis_set=orb_basis)
1539 NULLIFY (gth_potential, sgp_potential)
1540 CALL get_qs_kind(qs_kind=qs_kind, hard_radius=rc, &
1541 max_rad_local=max_rad_local_type, gpw_type_forced=gpw, &
1542 gth_potential=gth_potential, sgp_potential=sgp_potential)
1544 has_pseudopotential =
ASSOCIATED(gth_potential) .OR.
ASSOCIATED(sgp_potential)
1546 effective_force_paw = qs_control%gapw_control%force_paw .OR. &
1547 ASSOCIATED(qs_kind%cneo_potential)
1548 IF (has_pseudopotential)
THEN
1549 SELECT CASE (representation)
1551 effective_gpw = .true.
1552 effective_force_paw = .false.
1554 effective_gpw = .false.
1555 effective_force_paw = .true.
1559 cpabort(
"Unknown GAUXC PSEUDOPOTENTIAL_GAPW_REPRESENTATION value")
1561 IF (
ASSOCIATED(qs_kind%cneo_potential))
THEN
1562 effective_gpw = .false.
1563 effective_force_paw = .true.
1565 qs_kind%gpw_type_forced = effective_gpw
1568 NULLIFY (soft_basis)
1574 qs_control%gapw_control%eps_fit, rc, paw_atom, &
1575 effective_force_paw, effective_gpw)
1577 CALL set_qs_kind(qs_kind=qs_kind, paw_atom=paw_atom)
1579 bas1c = qs_control%gapw_control%basis_1c
1593 cpabort(
"basis_1c type")
1598 basis_1c%name = trim(bsname)//
"_1c"
1602 CALL get_qs_kind(qs_kind=qs_kind, paw_proj_set=paw_proj)
1603 CALL projectors(paw_proj, basis_1c, orb_basis, rc, qs_control, &
1604 max_rad_local_type, force_env_section)
1606 IF (my_mod_control) qs_control%gapw_control%non_paw_atoms = .true.
1610 NULLIFY (qs_kind%grid_atom, qs_kind%harmonics)
1616 IF (my_mod_control)
THEN
1617 IF (qs_control%gapw_control%non_paw_atoms)
THEN
1618 qs_control%gapw_control%nopaw_as_gpw = .true.
1620 qs_control%gapw_control%nopaw_as_gpw = .false.
1624 cpabort(
"The pointer qs_kind_set is not associated")
1634 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1636 INTEGER :: i, ic, ikind, n_nlcc, nc, nexp_nlcc, &
1638 INTEGER,
DIMENSION(:),
POINTER :: nct_nlcc
1639 LOGICAL :: nlcc, nlcc_type, paw_atom
1640 REAL(
dp) :: alpha, coa, cval
1641 REAL(kind=
dp),
DIMENSION(:),
POINTER :: a_nlcc, alpha_nlcc, c_nlcc, fe, rc, rr
1642 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: cval_nlcc, den
1647 IF (
ASSOCIATED(qs_kind_set))
THEN
1650 nkind =
SIZE(qs_kind_set)
1652 qs_kind => qs_kind_set(ikind)
1655 CALL get_qs_kind(qs_kind, gth_potential=gth_potential)
1656 CALL get_qs_kind(qs_kind, sgp_potential=sgp_potential)
1657 IF (
ASSOCIATED(gth_potential))
THEN
1658 CALL get_potential(potential=gth_potential, nlcc_present=nlcc_type, &
1659 nexp_nlcc=nexp_nlcc, alpha_nlcc=alpha_nlcc, nct_nlcc=nct_nlcc, cval_nlcc=cval_nlcc)
1661 nr = qs_kind%grid_atom%nr
1662 rr => qs_kind%grid_atom%rad
1663 ALLOCATE (qs_kind%nlcc_pot(nr, 2), rc(nr), fe(nr))
1664 den => qs_kind%nlcc_pot
1667 alpha = alpha_nlcc(i)
1669 fe(:) = exp(-0.5_dp*rc(:)*rc(:))
1672 cval = cval_nlcc(ic, i)
1674 den(:, 1) = den(:, 1) + fe(:)*rc**(2*ic - 2)*cval
1675 den(:, 2) = den(:, 2) - fe(:)*rc**(2*ic - 1)*coa
1677 den(:, 2) = den(:, 2) + real(2*ic - 2,
dp)*fe(:)*rc**(2*ic - 3)*coa
1683 ELSE IF (
ASSOCIATED(sgp_potential))
THEN
1685 n_nlcc=n_nlcc, a_nlcc=a_nlcc, c_nlcc=c_nlcc)
1687 nr = qs_kind%grid_atom%nr
1688 rr => qs_kind%grid_atom%rad
1689 ALLOCATE (qs_kind%nlcc_pot(nr, 2), rc(nr), fe(nr))
1690 den => qs_kind%nlcc_pot
1694 fe(:) = exp(-alpha*rr(:)*rr(:))
1696 den(:, 1) = den(:, 1) + cval*fe(:)
1697 den(:, 2) = den(:, 2) - 2.0_dp*alpha*cval*rr(:)*fe(:)
1708 cpabort(
"The pointer qs_kind_set is not associated")
1720 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1723 INTEGER :: ikind, nkind
1729 IF (
ASSOCIATED(qs_kind_set))
THEN
1731 nkind =
SIZE(qs_kind_set)
1735 qs_kind => qs_kind_set(ikind)
1737 IF (
ASSOCIATED(qs_kind%cneo_potential))
THEN
1738 CALL get_qs_kind(qs_kind=qs_kind, basis_set=orb_basis, basis_type=
"NUC", &
1741 NULLIFY (soft_basis)
1744 qs_control%gapw_control%eps_fit/ &
1745 sqrt(qs_kind%cneo_potential%zeff), &
1746 rc, paw_atom, .true., .false.)
1753 cpabort(
"The pointer qs_kind_set is not associated")
1764 SUBROUTINE set_potential_file_names(potential_file_names, dft_potential_file_names, &
1765 kind_potential_file_name)
1767 CHARACTER(LEN=default_path_length),
DIMENSION(:), &
1768 INTENT(INOUT),
POINTER :: potential_file_names
1769 CHARACTER(LEN=default_path_length),
DIMENSION(:), &
1770 INTENT(IN) :: dft_potential_file_names
1771 CHARACTER(LEN=*),
INTENT(IN) :: kind_potential_file_name
1773 IF (
ASSOCIATED(potential_file_names))
DEALLOCATE (potential_file_names)
1774 IF (kind_potential_file_name ==
"-")
THEN
1775 ALLOCATE (potential_file_names(
SIZE(dft_potential_file_names)))
1776 potential_file_names(:) = dft_potential_file_names(:)
1778 ALLOCATE (potential_file_names(1))
1779 potential_file_names(1) = kind_potential_file_name
1782 END SUBROUTINE set_potential_file_names
1798 SUBROUTINE read_qs_kind(qs_kind, kind_section, para_env, force_env_section, &
1799 no_fail, method_id, silent)
1805 LOGICAL,
INTENT(IN) :: no_fail
1806 INTEGER,
INTENT(IN) :: method_id
1807 LOGICAL,
INTENT(IN) :: silent
1809 CHARACTER(LEN=*),
PARAMETER :: routinen =
'read_qs_kind'
1810 INTEGER,
PARAMETER :: maxbas = 20
1812 CHARACTER(LEN=2) :: element_symbol
1813 CHARACTER(len=default_path_length) :: kg_potential_fn_kind, potential_fn_kind
1814 CHARACTER(LEN=default_path_length),
DIMENSION(:), &
1815 POINTER :: dft_potential_file_names, &
1816 potential_file_names
1817 CHARACTER(LEN=default_string_length) :: akind_name, basis_type, keyword, &
1818 kgpot_name, kgpot_type, &
1819 potential_name, potential_type, tmp
1820 CHARACTER(LEN=default_string_length),
DIMENSION(4) :: description
1821 CHARACTER(LEN=default_string_length), &
1822 DIMENSION(:),
POINTER :: tmpstringlist
1823 CHARACTER(LEN=default_string_length), &
1824 DIMENSION(maxbas) :: basis_set_form, basis_set_name, &
1826 INTEGER :: handle, i, i_rep, iounit, ipaodesc, ipaopot, ipos, j, jj, k_rep, l, m, &
1827 n_potential_files, n_rep, nb_rep, nexp, ngauss, nlcc, nloc, nnl, norbitals, npaodesc, &
1828 npaopot, nppnl, nspin, nu, plus_u_method_id, z
1829 INTEGER,
DIMENSION(:),
POINTER :: add_el, elec_conf, orbitals
1830 LOGICAL :: check, ecp_semi_local, explicit, explicit_basis, explicit_j, explicit_kgpot, &
1831 explicit_potential, explicit_u, explicit_u_m_j, l_explicit, n_explicit, nobasis, &
1832 nobasis_nuc, section_enabled, subsection_enabled, update_input
1833 REAL(kind=
dp) :: alpha, ccore, mass, r, rc, &
1835 REAL(kind=
dp),
DIMENSION(6) :: error
1836 REAL(kind=
dp),
DIMENSION(:),
POINTER :: a_nl, aloc, anlcc, cloc, cnlcc, nelec, &
1837 proj_shell_charge, &
1838 tmp_perturbation_strength
1839 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: h_nl
1840 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: c_nl
1843 TYPE(atom_upfpot_type) :: upfpot
1847 TYPE(
section_vals_type),
POINTER :: basis_section, bs_section, dft_plus_u_section, &
1848 dft_section, enforce_occupation_section, kgpot_section, &
1849 minimum_tracking_linear_response_section, pao_desc_section, pao_pot_section, &
1850 potential_section, spin_section, tensorial_projector_section
1853 CALL timeset(routinen, handle)
1859 NULLIFY (dft_potential_file_names, elec_conf, potential_file_names)
1861 update_input = .true.
1862 basis_set_name(:) =
""
1863 basis_set_type(:) =
""
1864 basis_set_form(:) =
""
1869 kg_potential_fn_kind =
"-"
1870 potential_fn_kind =
"-"
1872 zeff_correction = 0.0_dp
1874 explicit_basis = .false.
1875 explicit_j = .false.
1876 explicit_kgpot = .false.
1877 explicit_potential = .false.
1878 explicit_u = .false.
1879 explicit_u_m_j = .false.
1883 cpassert(n_potential_files > 0)
1884 ALLOCATE (dft_potential_file_names(n_potential_files))
1885 DO i = 1, n_potential_files
1887 c_val=dft_potential_file_names(i))
1891 akind_name = qs_kind%name
1896 c_val=keyword, i_rep_section=i_rep)
1898 IF (keyword == akind_name)
THEN
1905 ipos = index(qs_kind%name,
"_")
1906 IF (((ipos == 2) .OR. (ipos == 3)) .AND. (index(qs_kind%name,
"_ghost") == 0))
THEN
1909 akind_name = qs_kind%name(1:ipos - 1)
1913 c_val=keyword, i_rep_section=i_rep)
1915 IF (keyword == akind_name)
THEN
1926 element_symbol = qs_kind%element_symbol(1:2)
1930 c_val=keyword, i_rep_section=i_rep)
1932 IF (keyword == element_symbol)
THEN
1943 c_val=keyword, i_rep_section=i_rep)
1945 IF (keyword ==
"DEFAULT")
THEN
1946 update_input = .false.
1952 IF (k_rep < 0 .AND. (.NOT. no_fail))
THEN
1953 CALL cp_abort(__location__, &
1954 "No &KIND section was possible to associate to the atomic kind <"// &
1955 trim(akind_name)//
">. The KIND section were also scanned for the"// &
1956 " corresponding element <"//trim(qs_kind%element_symbol)//
">"// &
1957 " and for the DEFAULT section but no match was found. Check your input file!")
1966 keyword_name=
"BASIS_SET", &
1967 explicit=explicit, &
1969 IF (.NOT. explicit) nb_rep = 0
1970 cpassert(nb_rep <= maxbas)
1973 keyword_name=
"BASIS_SET", i_rep_val=i, c_vals=tmpstringlist)
1974 IF (
SIZE(tmpstringlist) == 1)
THEN
1976 basis_set_type(i) =
"ORB"
1977 basis_set_form(i) =
"GTO"
1978 basis_set_name(i) = tmpstringlist(1)
1979 ELSE IF (
SIZE(tmpstringlist) == 2)
THEN
1981 basis_set_type(i) = tmpstringlist(1)
1982 basis_set_form(i) =
"GTO"
1983 basis_set_name(i) = tmpstringlist(2)
1984 ELSE IF (
SIZE(tmpstringlist) == 3)
THEN
1985 basis_set_type(i) = tmpstringlist(1)
1986 basis_set_form(i) = tmpstringlist(2)
1987 basis_set_name(i) = tmpstringlist(3)
1989 CALL cp_abort(__location__, &
1990 "invalid number of BASIS_SET keyword parameters: BASIS_SET [<TYPE>] [<FORM>] <NAME>")
1993 IF (basis_set_form(i) /=
"GTO" .AND. basis_set_form(i) /=
"STO")
THEN
1994 cpabort(
"invalid BASIS_SET FORM parameter")
2000 i_val=qs_kind%pao_basis_size)
2005 c_val=qs_kind%pao_model_file)
2011 ALLOCATE (qs_kind%pao_potentials(npaopot))
2012 DO ipaopot = 1, npaopot
2014 i_val=qs_kind%pao_potentials(ipaopot)%maxl)
2015 CALL section_vals_val_get(pao_pot_section, keyword_name=
"MAX_PROJECTOR", i_rep_section=ipaopot, &
2016 i_val=qs_kind%pao_potentials(ipaopot)%max_projector)
2018 r_val=qs_kind%pao_potentials(ipaopot)%beta)
2020 r_val=qs_kind%pao_potentials(ipaopot)%weight)
2026 ALLOCATE (qs_kind%pao_descriptors(npaodesc))
2027 DO ipaodesc = 1, npaodesc
2029 r_val=qs_kind%pao_descriptors(ipaodesc)%beta)
2030 CALL section_vals_val_get(pao_desc_section, keyword_name=
"SCREENING", i_rep_section=ipaodesc, &
2031 r_val=qs_kind%pao_descriptors(ipaodesc)%screening)
2033 r_val=qs_kind%pao_descriptors(ipaodesc)%weight)
2038 keyword_name=
"ELEC_CONF", n_rep_val=i)
2041 keyword_name=
"ELEC_CONF", i_vals=elec_conf)
2045 keyword_name=
"CORE_CORRECTION", r_val=zeff_correction)
2048 keyword_name=
"POTENTIAL_FILE_NAME", c_val=potential_fn_kind)
2050 keyword_name=
"POTENTIAL_TYPE", c_val=potential_type)
2052 explicit=explicit, keyword_name=
"POTENTIAL", c_vals=tmpstringlist)
2054 IF (
SIZE(tmpstringlist) == 1)
THEN
2056 potential_name = tmpstringlist(1)
2057 IF (potential_type ==
"")
THEN
2058 ipos = index(potential_name,
"-")
2060 potential_type = potential_name(:ipos - 1)
2062 potential_type = potential_name
2065 ELSE IF (
SIZE(tmpstringlist) == 2)
THEN
2066 potential_type = tmpstringlist(1)
2067 potential_name = tmpstringlist(2)
2069 cpabort(
"POTENTIAL input list is not correct")
2076 keyword_name=
"KG_POTENTIAL_FILE_NAME", c_val=kg_potential_fn_kind)
2078 keyword_name=
"KG_POTENTIAL", c_val=kgpot_name)
2082 keyword_name=
"ECP_SEMI_LOCAL", l_val=ecp_semi_local)
2085 qs_kind%covalent_radius =
ptable(z)%covalent_radius*
bohr
2087 keyword_name=
"COVALENT_RADIUS", r_val=r)
2088 IF (r > 0.0_dp) qs_kind%covalent_radius = r
2091 qs_kind%vdw_radius =
ptable(z)%vdw_radius*
bohr
2093 keyword_name=
"VDW_RADIUS", r_val=r)
2094 IF (r > 0.0_dp) qs_kind%vdw_radius = r
2098 keyword_name=
"HARD_EXP_RADIUS")
2101 qs_kind%hard_radius = 1.2_dp
2103 qs_kind%hard_radius = 0.8_dp*
bohr
2107 keyword_name=
"HARD_EXP_RADIUS", r_val=qs_kind%hard_radius)
2112 keyword_name=
"RHO0_EXP_RADIUS")
2114 qs_kind%hard0_radius = qs_kind%hard_radius
2117 keyword_name=
"RHO0_EXP_RADIUS", r_val=qs_kind%hard0_radius)
2119 IF (qs_kind%hard_radius < qs_kind%hard0_radius)
THEN
2120 cpabort(
"rc0 should be <= rc")
2124 keyword_name=
"MAX_RAD_LOCAL", r_val=qs_kind%max_rad_local)
2126 keyword_name=
"LEBEDEV_GRID", i_val=qs_kind%ngrid_ang)
2127 IF (qs_kind%ngrid_ang <= 0)
THEN
2128 cpabort(
"# point lebedev grid < 0")
2131 keyword_name=
"RADIAL_GRID", i_val=qs_kind%ngrid_rad)
2132 IF (qs_kind%ngrid_rad <= 0)
THEN
2133 cpabort(
"# point radial grid < 0")
2136 keyword_name=
"GPW_TYPE", l_val=qs_kind%gpw_type_forced)
2138 keyword_name=
"GHOST", l_val=qs_kind%ghost)
2140 keyword_name=
"FLOATING_BASIS_CENTER", l_val=qs_kind%floating)
2142 keyword_name=
"NO_OPTIMIZE", l_val=qs_kind%no_optimize)
2146 keyword_name=
"MAGNETIZATION", r_val=qs_kind%magnetization)
2149 keyword_name=
"DFTB3_PARAM", r_val=qs_kind%dudq_dftb3)
2151 keyword_name=
"LMAX_DFTB", i_val=qs_kind%lmax_dftb)
2155 keyword_name=
"MAO", i_val=qs_kind%mao)
2159 keyword_name=
"MONOVALENT", l_val=qs_kind%monovalent)
2160 IF (qs_kind%monovalent .AND. trim(potential_type) /=
'GTH')
THEN
2161 cpabort(
"Monovalent pseudopotentials currently implemented for GTH only!")
2165 NULLIFY (bs_section)
2167 i_rep_section=k_rep)
2168 section_enabled = .false.
2170 l_val=section_enabled)
2171 IF (section_enabled)
THEN
2173 IF (qs_kind%magnetization /= 0.0_dp)
THEN
2174 CALL cp_abort(__location__,
"BS Section is in conflict with non-zero magnetization "// &
2175 "for this atom kind.")
2177 qs_kind%bs_occupation = .true.
2179 NULLIFY (spin_section)
2185 keyword_name=
"NEL", i_vals=add_el)
2186 cpassert(
ASSOCIATED(add_el))
2187 ALLOCATE (qs_kind%addel(
SIZE(add_el), 2))
2189 qs_kind%addel(1:
SIZE(add_el), 1) = add_el(1:
SIZE(add_el))
2192 keyword_name=
"L", i_vals=add_el)
2193 cpassert(
ASSOCIATED(add_el))
2194 cpassert(
SIZE(add_el) ==
SIZE(qs_kind%addel, 1))
2195 ALLOCATE (qs_kind%laddel(
SIZE(add_el), 2))
2197 qs_kind%laddel(1:
SIZE(add_el), 1) = add_el(1:
SIZE(add_el))
2198 ALLOCATE (qs_kind%naddel(
SIZE(add_el), 2))
2202 keyword_name=
"N", n_rep_val=i)
2205 keyword_name=
"N", i_vals=add_el)
2206 IF (
SIZE(add_el) ==
SIZE(qs_kind%addel, 1))
THEN
2207 qs_kind%naddel(1:
SIZE(add_el), 1) = add_el(1:
SIZE(add_el))
2212 NULLIFY (spin_section)
2218 keyword_name=
"NEL", i_vals=add_el)
2219 cpassert(
SIZE(add_el) ==
SIZE(qs_kind%addel, 1))
2220 qs_kind%addel(1:
SIZE(add_el), 2) = add_el(1:
SIZE(add_el))
2221 qs_kind%addel(:, :) = qs_kind%addel(:, :)
2224 keyword_name=
"L", i_vals=add_el)
2225 cpassert(
SIZE(add_el) ==
SIZE(qs_kind%addel, 1))
2226 qs_kind%laddel(1:
SIZE(add_el), 2) = add_el(1:
SIZE(add_el))
2229 keyword_name=
"N", n_rep_val=i)
2233 keyword_name=
"N", i_vals=add_el)
2234 IF (
SIZE(add_el) ==
SIZE(qs_kind%addel, 1))
THEN
2235 qs_kind%naddel(1:
SIZE(add_el), 2) = add_el(1:
SIZE(add_el))
2243 NULLIFY (dft_plus_u_section)
2245 subsection_name=
"DFT_PLUS_U", &
2246 i_rep_section=k_rep)
2247 section_enabled = .false.
2249 keyword_name=
"_SECTION_PARAMETERS_", &
2250 l_val=section_enabled)
2251 IF (section_enabled)
THEN
2252 ALLOCATE (qs_kind%dft_plus_u)
2253 NULLIFY (qs_kind%dft_plus_u%nelec)
2254 NULLIFY (qs_kind%dft_plus_u%orbitals)
2258 qs_kind%dft_plus_u%l = l
2259#if defined(__SIRIUS)
2263 qs_kind%dft_plus_u%n = nu
2267 r_val=qs_kind%dft_plus_u%U, &
2268 explicit=explicit_u)
2272 r_val=qs_kind%dft_plus_u%J, &
2273 explicit=explicit_j)
2276 keyword_name=
"alpha", &
2277 r_val=qs_kind%dft_plus_u%alpha)
2280 keyword_name=
"beta", &
2281 r_val=qs_kind%dft_plus_u%beta)
2284 keyword_name=
"J0", &
2285 r_val=qs_kind%dft_plus_u%J0)
2288 keyword_name=
"occupation", &
2289 r_val=qs_kind%dft_plus_u%occupation)
2295 keyword_name=
"U_MINUS_J", &
2296 r_val=qs_kind%dft_plus_u%u_minus_j_target, &
2297 explicit=explicit_u_m_j)
2300 keyword_name=
"PLUS_U_METHOD", &
2301 i_val=plus_u_method_id)
2304 IF (explicit_u)
THEN
2305 CALL cp_abort(__location__,
"Lowdin and tensorial DFT+U+J do not allow U "// &
2306 "to be specified. Use U_MINUS_J and J.")
2309 IF ((explicit_u .OR. explicit_j) .AND. explicit_u_m_j)
THEN
2310 cpabort(
"DFT+U| specifying U or J and U_MINUS_J parameters are mutually exclusive.")
2315 l_explicit = .false.
2316 n_explicit = .false.
2317 explicit_j = .false.
2322 i_val=qs_kind%dft_plus_u%l, &
2323 explicit=l_explicit)
2326 i_val=qs_kind%dft_plus_u%n, &
2327 explicit=n_explicit)
2330 r_val=qs_kind%dft_plus_u%J, &
2331 explicit=explicit_j)
2332 qs_kind%dft_plus_u%hund_j = qs_kind%dft_plus_u%J
2333 IF (.NOT. l_explicit .OR. .NOT. n_explicit)
THEN
2334 CALL cp_abort(__location__,
"DFT PLUS_U_METHOD TENSORIAL requires explicit L "// &
2335 "and N keywords in every active DFT_PLUS_U section.")
2342 r_val=qs_kind%dft_plus_u%J, &
2343 explicit=explicit_j)
2344 qs_kind%dft_plus_u%hund_j = qs_kind%dft_plus_u%J
2348 keyword_name=
"U_RAMPING", &
2349 r_val=qs_kind%dft_plus_u%u_ramping)
2351 keyword_name=
"INIT_U_RAMPING_EACH_SCF", &
2352 l_val=qs_kind%dft_plus_u%init_u_ramping_each_scf)
2353 IF (qs_kind%dft_plus_u%u_ramping > 0.0_dp)
THEN
2354 qs_kind%dft_plus_u%u_minus_j = 0.0_dp
2356 qs_kind%dft_plus_u%u_minus_j = qs_kind%dft_plus_u%u_minus_j_target
2359 keyword_name=
"EPS_U_RAMPING", &
2360 r_val=qs_kind%dft_plus_u%eps_u_ramping)
2362 NULLIFY (enforce_occupation_section)
2364 subsection_name=
"ENFORCE_OCCUPATION")
2365 subsection_enabled = .false.
2367 keyword_name=
"_SECTION_PARAMETERS_", &
2368 l_val=subsection_enabled)
2369 IF (subsection_enabled)
THEN
2372 keyword_name=
"NELEC", &
2375 ALLOCATE (qs_kind%dft_plus_u%nelec(nspin))
2376 qs_kind%dft_plus_u%nelec(:) = nelec(:)
2379 keyword_name=
"ORBITALS", &
2381 norbitals =
SIZE(orbitals)
2382 IF (norbitals <= 0 .OR. norbitals > 2*l + 1)
THEN
2383 CALL cp_abort(__location__,
"DFT+U| Invalid number of ORBITALS specified: "// &
2384 "1 to 2*L+1 integer numbers are expected")
2386 ALLOCATE (qs_kind%dft_plus_u%orbitals(norbitals))
2387 qs_kind%dft_plus_u%orbitals(:) = orbitals(:)
2390 IF (qs_kind%dft_plus_u%orbitals(m) > l)
THEN
2391 cpabort(
"DFT+U| Invalid orbital magnetic quantum number specified: m > l")
2393 IF (qs_kind%dft_plus_u%orbitals(m) < -l)
THEN
2394 cpabort(
"DFT+U| Invalid orbital magnetic quantum number specified: m < -l")
2398 IF (qs_kind%dft_plus_u%orbitals(j) == qs_kind%dft_plus_u%orbitals(m))
THEN
2399 cpabort(
"DFT+U| An orbital magnetic quantum number was specified twice")
2405 keyword_name=
"EPS_SCF", &
2406 r_val=qs_kind%dft_plus_u%eps_scf)
2408 keyword_name=
"MAX_SCF", &
2410 qs_kind%dft_plus_u%max_scf = max(-1, i)
2412 keyword_name=
"SMEAR", &
2413 l_val=qs_kind%dft_plus_u%smear)
2416 NULLIFY (tensorial_projector_section)
2418 subsection_name=
"ATOMIC_PROJECTOR_TENSORIAL")
2419 subsection_enabled = .false.
2421 keyword_name=
"_SECTION_PARAMETERS_", &
2422 l_val=subsection_enabled)
2423 IF (subsection_enabled)
THEN
2425 keyword_name=
"SHELL_CHARGE", &
2426 r_vals=proj_shell_charge)
2427 qs_kind%dft_plus_u%proj_shell_charge = proj_shell_charge
2430 NULLIFY (minimum_tracking_linear_response_section)
2432 subsection_name=
"MINIMUM_TRACKING_LINEAR_RESPONSE")
2433 subsection_enabled = .false.
2435 keyword_name=
"_SECTION_PARAMETERS_", &
2436 l_val=subsection_enabled)
2437 IF (subsection_enabled)
THEN
2438 qs_kind%dft_plus_u%do_mtlr = .true.
2440 keyword_name=
"INDEX_PERTURBED_ATOM", &
2441 i_val=qs_kind%dft_plus_u%lr_atom)
2442 IF (qs_kind%dft_plus_u%lr_atom < 1)
THEN
2443 cpabort(
"MTLR requires an explicit positive INDEX_PERTURBED_ATOM.")
2445 NULLIFY (tmp_perturbation_strength)
2447 keyword_name=
"PERTURBATION_STRENGTH", &
2448 r_vals=tmp_perturbation_strength)
2449 IF (.NOT.
ASSOCIATED(tmp_perturbation_strength))
THEN
2450 cpabort(
"MTLR perturbation strengths could not be read.")
2452 IF (
SIZE(tmp_perturbation_strength) < 3 .OR.
SIZE(tmp_perturbation_strength) > 9)
THEN
2453 CALL cp_abort(__location__, &
2454 "PERTURBATION_STRENGTH must contain between 3 and 9 values.")
2456 IF (maxval(tmp_perturbation_strength) - minval(tmp_perturbation_strength) <= &
2457 100.0_dp*epsilon(1.0_dp))
THEN
2458 cpabort(
"MTLR perturbation strengths must contain distinct values.")
2460 IF (
ALLOCATED(qs_kind%dft_plus_u%perturbation_strength))
THEN
2461 DEALLOCATE (qs_kind%dft_plus_u%perturbation_strength)
2463 ALLOCATE (qs_kind%dft_plus_u%perturbation_strength(
SIZE(tmp_perturbation_strength)))
2464 qs_kind%dft_plus_u%perturbation_strength(:) = tmp_perturbation_strength(:)
2467 NULLIFY (tmp_perturbation_strength)
2478 explicit_basis = .false.
2481 can_return_null=.true.)
2485 explicit_potential = .false.
2488 i_rep_section=k_rep, can_return_null=.true.)
2492 explicit_kgpot = .false.
2495 i_rep_section=k_rep, can_return_null=.true.)
2499 CALL set_potential_file_names(potential_file_names, dft_potential_file_names, potential_fn_kind)
2501 SELECT CASE (method_id)
2508 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2509 CALL get_potential(potential=qs_kind%all_potential, elec_conf=elec_conf)
2512 cpassert(.NOT. qs_kind%floating)
2513 IF (qs_kind%ghost)
THEN
2514 CALL get_qs_kind(qs_kind=qs_kind, elec_conf=elec_conf)
2517 elec_conf=elec_conf)
2521 zeff_correction=0.0_dp)
2526 check = .NOT.
ASSOCIATED(qs_kind%se_parameter)
2534 keyword_name=
"SE_P_ORBITALS_ON_H", l_val=qs_kind%se_parameter%p_orbitals_on_h)
2542 NULLIFY (tmp_basis_set)
2543 CALL init_se_param(qs_kind%se_parameter, tmp_basis_set, ngauss)
2546 zeff=qs_kind%se_parameter%zeff, zeff_correction=zeff_correction)
2547 qs_kind%se_parameter%zeff = qs_kind%se_parameter%zeff - zeff_correction
2549 check = ((potential_name /=
'') .OR. explicit_potential) .AND. .NOT. silent
2551 CALL cp_warn(__location__, &
2552 "Information provided in the input file regarding POTENTIAL for KIND <"// &
2553 trim(qs_kind%name)//
"> will be ignored!")
2556 check = ((k_rep > 0) .OR. explicit_basis) .AND. .NOT. silent
2558 CALL cp_warn(__location__, &
2559 "Information provided in the input file regarding BASIS for KIND <"// &
2560 trim(qs_kind%name)//
"> will be ignored!")
2568 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2569 CALL get_potential(potential=qs_kind%all_potential, elec_conf=elec_conf)
2572 cpassert(.NOT. qs_kind%floating)
2573 IF (qs_kind%ghost)
THEN
2574 CALL get_qs_kind(qs_kind=qs_kind, elec_conf=elec_conf)
2577 elec_conf=elec_conf)
2581 zeff_correction=0.0_dp)
2584 check = ((potential_name /=
'') .OR. explicit_potential) .AND. .NOT. silent
2586 CALL cp_warn(__location__, &
2587 "Information provided in the input file regarding POTENTIAL for KIND <"// &
2588 trim(qs_kind%name)//
"> will be ignored!")
2591 check = ((k_rep > 0) .OR. explicit_basis) .AND. .NOT. silent
2593 CALL cp_warn(__location__, &
2594 "Information provided in the input file regarding BASIS for KIND <"// &
2595 trim(qs_kind%name)//
"> will be ignored!")
2603 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2604 CALL get_potential(potential=qs_kind%all_potential, elec_conf=elec_conf)
2607 cpassert(.NOT. qs_kind%floating)
2608 IF (qs_kind%ghost)
THEN
2609 CALL get_qs_kind(qs_kind=qs_kind, elec_conf=elec_conf)
2612 elec_conf=elec_conf)
2616 zeff_correction=0.0_dp)
2619 check = ((potential_name /=
'') .OR. explicit_potential) .AND. .NOT. silent
2621 CALL cp_warn(__location__, &
2622 "Information provided in the input file regarding POTENTIAL for KIND <"// &
2623 trim(qs_kind%name)//
"> will be ignored!")
2626 check = ((k_rep > 0) .OR. explicit_basis) .AND. .NOT. silent
2628 CALL cp_warn(__location__, &
2629 "Information provided in the input file regarding BASIS for KIND <"// &
2630 trim(qs_kind%name)//
"> will be ignored!")
2636 IF (potential_name /=
'')
THEN
2637 SELECT CASE (trim(potential_type))
2638 CASE (
"ALL",
"ECP",
"CNEO")
2639 CALL cp_abort(__location__, &
2640 "PW DFT calculations only with potential type UPF or GTH possible."// &
2641 " <"//trim(potential_type)//
"> was specified "// &
2642 "for the atomic kind <"//trim(qs_kind%name))
2646 qs_kind%gth_potential, zeff_correction, para_env, &
2647 potential_file_names, potential_section, update_input, &
2648 monovalent=qs_kind%monovalent)
2651 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2652 CALL get_potential(potential=qs_kind%gth_potential, elec_conf=elec_conf)
2655 CALL set_potential(potential=qs_kind%gth_potential, elec_conf=elec_conf)
2658 ALLOCATE (qs_kind%upf_potential)
2659 qs_kind%upf_potential%zion = 0
2660 qs_kind%upf_potential%filename = adjustl(trim(potential_name))
2662 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2663 CALL set_qs_kind(qs_kind, elec_conf=qs_kind%upf_potential%econf)
2666 CALL cp_abort(__location__, &
2667 "An invalid potential type <"// &
2668 trim(potential_type)//
"> was specified "// &
2669 "for the atomic kind <"// &
2673 CALL cp_abort(__location__, &
2674 "No potential type was defined for the "// &
2675 "atomic kind <"//trim(qs_kind%name)//
">")
2685 SELECT CASE (basis_set_form(i))
2687 NULLIFY (tmp_basis_set)
2690 tmp_basis_set, para_env, dft_section)
2692 NULLIFY (sto_basis_set)
2695 sto_basis_set, para_env, dft_section)
2696 NULLIFY (tmp_basis_set)
2700 CALL cp_abort(__location__, &
2701 "Invalid basis set form "//trim(basis_set_form(i))// &
2702 "for atomic kind <"//trim(qs_kind%name)//
">")
2704 tmp = basis_set_type(i)
2709 IF (explicit_basis)
THEN
2712 NULLIFY (tmp_basis_set)
2715 tmp_basis_set, basis_section, i, dft_section)
2722 DO i = 1,
SIZE(qs_kind%basis_sets)
2723 NULLIFY (tmp_basis_set)
2725 inumbas=i, basis_type=basis_type)
2726 IF (basis_type ==
"") cycle
2728 DO j = i + 1,
SIZE(qs_kind%basis_sets)
2730 NULLIFY (sup_basis_set)
2732 inumbas=jj, basis_type=tmp)
2733 IF (basis_type == tmp)
THEN
2740 NULLIFY (sup_basis_set)
2745 DO i = 1,
SIZE(qs_kind%basis_sets)
2746 NULLIFY (tmp_basis_set)
2748 inumbas=i, basis_type=basis_type)
2749 IF (basis_type ==
"ORB") nobasis = .false.
2752 CALL cp_abort(__location__, &
2753 "No basis set type was defined for the "// &
2754 "atomic kind <"//trim(qs_kind%name)//
">")
2758 IF (qs_kind%ghost .OR. qs_kind%floating)
THEN
2759 IF (
ASSOCIATED(qs_kind%elec_conf)) qs_kind%elec_conf = 0
2762 IF ((potential_name /=
'') .OR. explicit_potential)
THEN
2763 SELECT CASE (trim(potential_type))
2767 qs_kind%all_potential, zeff_correction, para_env, &
2768 potential_file_names, potential_section, update_input)
2771 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2772 CALL get_potential(potential=qs_kind%all_potential, elec_conf=elec_conf)
2775 CALL set_potential(potential=qs_kind%all_potential, elec_conf=elec_conf)
2780 qs_kind%gth_potential, zeff_correction, para_env, &
2781 potential_file_names, potential_section, update_input, &
2782 monovalent=qs_kind%monovalent)
2785 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2786 CALL get_potential(potential=qs_kind%gth_potential, elec_conf=elec_conf)
2789 CALL set_potential(potential=qs_kind%gth_potential, elec_conf=elec_conf)
2793 CALL get_potential(qs_kind%sgp_potential, description=description)
2795 potential_name, potential_file_names, potential_section)
2796 IF (ecp_semi_local)
THEN
2797 description(1) =
"Semi-local Gaussian pseudopotential "
2798 description(2) =
"ECP "//trim(potential_name)
2799 description(3) =
"LIBGRPP: A. V. Oleynichenko et al., Symmetry 15 197 2023"
2800 description(4) =
" "
2802 description(4) =
"ECP "//trim(potential_name)
2804 CALL set_potential(qs_kind%sgp_potential, name=ecppot%pname, description=description, &
2805 zeff=ecppot%zion, z=z, ecp_local=.true., ecp_semi_local=ecp_semi_local, &
2806 nloc=ecppot%nloc, nrloc=ecppot%nrloc, aloc=ecppot%aloc, bloc=ecppot%bloc, &
2808 CALL set_potential(qs_kind%sgp_potential, sl_lmax=ecppot%lmax, &
2809 npot=ecppot%npot, nrpot=ecppot%nrpot, apot=ecppot%apot, bpot=ecppot%bpot)
2811 IF (.NOT. ecp_semi_local)
THEN
2812 cpabort(
"ECPs are only well tested in their semi-local form")
2813 CALL get_qs_kind(qs_kind, basis_set=orb_basis_set)
2814 CALL sgp_construction(sgp_pot=sgppot, ecp_pot=ecppot, orb_basis=orb_basis_set, error=error)
2815 IF (iounit > 0 .AND. .NOT. silent)
THEN
2816 WRITE (iounit,
"(/,T2,'PP Transformation for ',A)") trim(ecppot%pname)
2817 IF (sgppot%has_local)
THEN
2818 WRITE (iounit,
"(T8,'Accuracy for local part:',T41,F10.3,'%',T61,F20.12)") error(4), error(1)
2820 IF (sgppot%has_nonlocal)
THEN
2821 WRITE (iounit,
"(T8,'Accuracy for nonlocal part:',T41,F10.3,'%',T61,F20.12)") error(5), error(2)
2823 IF (sgppot%has_nlcc)
THEN
2824 WRITE (iounit,
"(T8,'Accuracy for NLCC density:',T61,F20.12)") error(3)
2828 IF (sgppot%has_nonlocal)
THEN
2829 CALL set_potential(qs_kind%sgp_potential, n_nonlocal=sgppot%n_nonlocal, lmax=sgppot%lmax, &
2830 is_nonlocal=sgppot%is_nonlocal)
2831 nnl = sgppot%n_nonlocal
2833 DO l = 0, sgppot%lmax
2834 nppnl = nppnl + nnl*
nco(l)
2837 ALLOCATE (a_nl(nnl), h_nl(nnl, 0:l), c_nl(nnl, nnl, 0:l))
2838 a_nl(:) = sgppot%a_nonlocal(:)
2839 h_nl(:, :) = sgppot%h_nonlocal(:, :)
2840 c_nl(:, :, :) = sgppot%c_nonlocal(:, :, :)
2841 CALL set_potential(qs_kind%sgp_potential, nppnl=nppnl, a_nonlocal=a_nl, h_nonlocal=h_nl, c_nonlocal=c_nl)
2843 CALL set_potential(qs_kind%sgp_potential, n_nonlocal=0, lmax=-1, is_nonlocal=sgppot%is_nonlocal)
2847 cpassert(.NOT. sgppot%has_local)
2848 cpassert(.NOT. sgppot%has_nlcc)
2850 rc = 0.5_dp*qs_kind%covalent_radius*
angstrom
2851 rc = max(rc, 0.2_dp)
2852 rc = min(rc, 1.0_dp)
2853 alpha = 1.0_dp/(2.0_dp*rc**2)
2854 ccore = ecppot%zion*sqrt((alpha/
pi)**3)
2855 CALL set_potential(qs_kind%sgp_potential, alpha_core_charge=alpha, ccore_charge=ccore, &
2856 core_charge_radius=rc)
2859 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2863 CALL set_potential(qs_kind%sgp_potential, elec_conf=elec_conf)
2866 CALL get_potential(qs_kind%sgp_potential, description=description)
2867 description(4) =
"UPF "//trim(potential_name)
2869 IF (trim(upfpot%pseudo_type) ==
"NC")
THEN
2870 ALLOCATE (qs_kind%sgp_potential%upf_data, source=upfpot)
2872 CALL set_potential(qs_kind%sgp_potential, name=upfpot%pname, description=description, &
2873 zeff=upfpot%zion, z=z,
has_nlcc=upfpot%core_correction)
2876 IF (iounit > 0 .AND. .NOT. silent)
THEN
2877 WRITE (iounit,
"(/,T2,'PP Transformation for ',A)") trim(upfpot%pname)
2878 IF (sgppot%has_local)
THEN
2879 WRITE (iounit,
"(T8,'Auxiliary local Gaussian fit error:',T61,F20.12)") error(1)
2881 IF (sgppot%has_nonlocal)
THEN
2882 IF (
ALLOCATED(qs_kind%sgp_potential%upf_data))
THEN
2883 WRITE (iounit,
"(T8,'Unused nonlocal Gaussian fit error:',T61,F20.12)") error(2)
2885 WRITE (iounit,
"(T8,'Accuracy for nonlocal part:',T61,F20.12)") error(2)
2888 IF (sgppot%has_nlcc)
THEN
2889 WRITE (iounit,
"(T8,'Accuracy for NLCC density:',T61,F20.12)") error(3)
2892 IF (sgppot%has_nonlocal)
THEN
2893 CALL set_potential(qs_kind%sgp_potential, n_nonlocal=sgppot%n_nonlocal, lmax=sgppot%lmax, &
2894 is_nonlocal=sgppot%is_nonlocal)
2895 nnl = sgppot%n_nonlocal
2897 DO l = 0, sgppot%lmax
2898 nppnl = nppnl + nnl*
nco(l)
2901 ALLOCATE (a_nl(nnl), h_nl(nnl, 0:l), c_nl(nnl, nnl, 0:l))
2902 a_nl(:) = sgppot%a_nonlocal(:)
2903 h_nl(:, :) = sgppot%h_nonlocal(:, :)
2904 c_nl(:, :, :) = sgppot%c_nonlocal(:, :, :)
2905 CALL set_potential(qs_kind%sgp_potential, nppnl=nppnl, a_nonlocal=a_nl, h_nonlocal=h_nl, c_nonlocal=c_nl)
2907 CALL set_potential(qs_kind%sgp_potential, n_nonlocal=0, lmax=-1, is_nonlocal=sgppot%is_nonlocal)
2910 cpassert(sgppot%has_local)
2912 rc = sgppot%ac_local
2913 alpha = 1.0_dp/(2.0_dp*rc**2)
2914 ccore = upfpot%zion*sqrt((alpha/
pi)**3)
2915 CALL set_potential(qs_kind%sgp_potential, alpha_core_charge=alpha, ccore_charge=ccore, &
2916 core_charge_radius=rc)
2918 nloc = sgppot%n_local
2919 ALLOCATE (aloc(nloc), cloc(nloc))
2920 aloc(1:nloc) = sgppot%a_local(1:nloc)
2921 cloc(1:nloc) = sgppot%c_local(1:nloc)
2922 CALL set_potential(qs_kind%sgp_potential, n_local=nloc, a_local=aloc, c_local=cloc)
2923 IF (sgppot%has_nlcc)
THEN
2924 nlcc = sgppot%n_nlcc
2925 ALLOCATE (anlcc(nlcc), cnlcc(nlcc))
2926 anlcc(1:nlcc) = sgppot%a_nlcc(1:nlcc)
2927 cnlcc(1:nlcc) = sgppot%c_nlcc(1:nlcc)
2932 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2936 CALL set_potential(qs_kind%sgp_potential, elec_conf=elec_conf)
2940 IF (zeff_correction /= 0.0_dp)
THEN
2941 cpabort(
"CORE_CORRECTION is not compatible with CNEO")
2951 keyword_name=
"MASS", n_rep_val=i)
2953 keyword_name=
"MASS", r_val=mass)
2956 IF (mass - real(z,
dp)*0.000548579909_dp > 0.0_dp)
THEN
2957 mass = mass - real(z,
dp)*0.000548579909_dp
2963 IF (abs(mass + real(z,
dp)*0.000548579909_dp -
ptable(z)%amass) < 1.e-4_dp)
THEN
2964 CALL cp_warn(__location__, &
2965 "Atomic mass of the atomic kind <"//trim(qs_kind%name)// &
2966 "> is very close to its average mass. Is it a pure isotope? "// &
2967 "Pure isotopes are preferable for CNEO. "// &
2968 "(e.g., mass of 1H is 1.007825, not 1.00794)")
2971 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2978 CALL cp_abort(__location__, &
2979 "An invalid potential type <"// &
2980 trim(potential_name)//
"> was specified "// &
2981 "for the atomic kind <"// &
2985 CALL cp_abort(__location__, &
2986 "No potential type was defined for the "// &
2987 "atomic kind <"//trim(qs_kind%name)//
">")
2990 CALL check_potential_basis_compatibility(qs_kind)
2993 IF ((kgpot_name /=
'') .OR. explicit_kgpot)
THEN
2994 ipos = index(kgpot_name,
"-")
2996 kgpot_type = kgpot_name(:ipos - 1)
2998 kgpot_type = kgpot_name
3002 SELECT CASE (trim(kgpot_type))
3004 CALL set_potential_file_names(potential_file_names, dft_potential_file_names, &
3005 kg_potential_fn_kind)
3008 qs_kind%tnadd_potential, para_env, &
3009 potential_file_names, kgpot_section, update_input)
3011 NULLIFY (qs_kind%tnadd_potential)
3013 CALL cp_abort(__location__, &
3014 "An invalid kg_potential type <"// &
3015 trim(potential_name)//
"> was specified "// &
3016 "for the atomic kind <"// &
3023 nobasis_nuc =
ASSOCIATED(qs_kind%cneo_potential)
3024 DO i = 1,
SIZE(qs_kind%basis_sets)
3025 NULLIFY (tmp_basis_set)
3027 inumbas=i, basis_type=basis_type)
3028 IF (basis_type ==
"NUC")
THEN
3029 nobasis_nuc = .false.
3030 IF (.NOT.
ASSOCIATED(qs_kind%cneo_potential))
THEN
3031 CALL cp_warn(__location__, &
3032 "POTENTIAL is not set to CNEO, NUC type basis set for KIND <"// &
3033 trim(qs_kind%name)//
"> will be ignored!")
3037 IF (nobasis_nuc)
THEN
3038 CALL cp_abort(__location__, &
3039 "No NUC type basis set was defined for the "// &
3040 "atomic kind <"//trim(qs_kind%name)//
">, which is required by "// &
3045 DEALLOCATE (dft_potential_file_names, potential_file_names)
3046 CALL timestop(handle)
3048 END SUBROUTINE read_qs_kind
3055 SUBROUTINE check_potential_basis_compatibility(qs_kind)
3058 CHARACTER(LEN=default_string_length) :: name
3063 CALL get_qs_kind(qs_kind, name=name, gth_potential=gth_potential, basis_set=basis_set)
3066 IF (
ASSOCIATED(gth_potential))
THEN
3067 npp = parse_valence_electrons(gth_potential%aliases)
3069 IF (
ASSOCIATED(basis_set))
THEN
3070 nbs = parse_valence_electrons(basis_set%aliases)
3073 IF (npp >= 0 .AND. nbs >= 0 .AND. npp /= nbs)
THEN
3074 CALL cp_abort(__location__,
"Basis-set and pseudo-potential of atomic kind '"//trim(name)//
"'"// &
3075 " were optimized for different valence electron numbers.")
3078 END SUBROUTINE check_potential_basis_compatibility
3086 FUNCTION parse_valence_electrons(string)
RESULT(n)
3087 CHARACTER(*) :: string
3090 INTEGER :: i, istat, j
3092 i = index(string,
"-Q", .true.)
3096 j = scan(string(i + 2:),
"- ")
3097 READ (string(i + 2:i + j),
'(I3)', iostat=istat) n
3098 IF (istat /= 0) n = -1
3101 END FUNCTION parse_valence_electrons
3113 force_env_section, silent)
3115 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
3120 LOGICAL,
INTENT(IN) :: silent
3122 CHARACTER(len=*),
PARAMETER :: routinen =
'create_qs_kind_set'
3124 INTEGER :: handle, ikind, method, nkind, qs_method
3127 CALL timeset(routinen, handle)
3129 IF (
ASSOCIATED(qs_kind_set)) cpabort(
"create_qs_kind_set: qs_kind_set already associated")
3130 IF (.NOT.
ASSOCIATED(atomic_kind_set)) cpabort(
"create_qs_kind_set: atomic_kind_set not associated")
3136 IF (method ==
do_qs)
THEN
3138 SELECT CASE (qs_method)
3153 nkind =
SIZE(atomic_kind_set)
3154 ALLOCATE (qs_kind_set(nkind))
3157 qs_kind_set(ikind)%name = atomic_kind_set(ikind)%name
3158 qs_kind_set(ikind)%element_symbol = atomic_kind_set(ikind)%element_symbol
3159 qs_kind_set(ikind)%natom = atomic_kind_set(ikind)%natom
3160 CALL read_qs_kind(qs_kind_set(ikind), kind_section, para_env, force_env_section, &
3161 no_fail, qs_method, silent)
3164 CALL timestop(handle)
3175 SUBROUTINE check_qs_kind(qs_kind, dft_control, subsys_section)
3187 IF (dft_control%qs_control%semi_empirical)
THEN
3188 CALL get_qs_kind(qs_kind, se_parameter=se_parameter)
3189 cpassert(
ASSOCIATED(se_parameter))
3193 ELSE IF (dft_control%qs_control%dftb)
THEN
3194 CALL get_qs_kind(qs_kind, dftb_parameter=dftb_parameter)
3195 cpassert(
ASSOCIATED(dftb_parameter))
3199 ELSE IF (dft_control%qs_control%xtb)
THEN
3200 IF (.NOT. (dft_control%qs_control%xtb_control%do_tblite))
THEN
3201 CALL get_qs_kind(qs_kind, xtb_parameter=xtb_parameter)
3202 cpassert(
ASSOCIATED(xtb_parameter))
3203 gfn_type = dft_control%qs_control%xtb_control%gfn_type
3208 END SUBROUTINE check_qs_kind
3218 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
3222 CHARACTER(len=*),
PARAMETER :: routinen =
'check_qs_kind_set'
3224 INTEGER :: handle, ikind, nkind
3227 CALL timeset(routinen, handle)
3228 IF (
ASSOCIATED(qs_kind_set))
THEN
3229 nkind =
SIZE(qs_kind_set)
3231 qs_kind => qs_kind_set(ikind)
3232 CALL check_qs_kind(qs_kind, dft_control, subsys_section)
3234 IF (dft_control%qs_control%xtb)
THEN
3235 CALL write_xtb_kab_param(qs_kind_set, subsys_section, &
3236 dft_control%qs_control%xtb_control)
3239 cpabort(
"The pointer qs_kind_set is not associated")
3241 CALL timestop(handle)
3250 SUBROUTINE write_xtb_kab_param(qs_kind_set, subsys_section, xtb_control)
3252 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
3256 CHARACTER(LEN=default_string_length) :: aname, bname
3257 INTEGER :: ikind, io_unit, jkind, nkind, za, zb
3260 TYPE(
xtb_atom_type),
POINTER :: xtb_parameter_a, xtb_parameter_b
3265 "PRINT%KINDS/POTENTIAL"),
cp_p_file))
THEN
3268 IF (io_unit > 0)
THEN
3270 WRITE (io_unit,
"(/,T2,A)")
"xTB| Kab parameters"
3271 nkind =
SIZE(qs_kind_set)
3273 qs_kinda => qs_kind_set(ikind)
3274 CALL get_qs_kind(qs_kinda, xtb_parameter=xtb_parameter_a)
3276 DO jkind = ikind, nkind
3277 qs_kindb => qs_kind_set(jkind)
3278 CALL get_qs_kind(qs_kindb, xtb_parameter=xtb_parameter_b)
3280 WRITE (io_unit,
"(A,T10,A15,T25,A15,T71,F10.3)") &
3281 " Kab:", trim(aname), trim(bname),
xtb_set_kab(za, zb, xtb_control)
3291 END SUBROUTINE write_xtb_kab_param
3315 SUBROUTINE set_qs_kind(qs_kind, paw_atom, ghost, floating, hard_radius, hard0_radius, &
3316 covalent_radius, vdw_radius, lmax_rho0, zeff, &
3317 no_optimize, dispersion, u_minus_j, hund_j, reltmat, &
3318 dftb_parameter, xtb_parameter, &
3319 elec_conf, pao_basis_size)
3322 LOGICAL,
INTENT(IN),
OPTIONAL :: paw_atom, ghost, floating
3323 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: hard_radius, hard0_radius, &
3324 covalent_radius, vdw_radius
3325 INTEGER,
INTENT(IN),
OPTIONAL :: lmax_rho0
3326 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: zeff
3327 LOGICAL,
INTENT(IN),
OPTIONAL :: no_optimize
3329 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: u_minus_j, hund_j
3330 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: reltmat
3333 INTEGER,
DIMENSION(:),
INTENT(IN),
OPTIONAL :: elec_conf
3334 INTEGER,
INTENT(IN),
OPTIONAL :: pao_basis_size
3336 IF (
PRESENT(dftb_parameter)) qs_kind%dftb_parameter => dftb_parameter
3337 IF (
PRESENT(xtb_parameter)) qs_kind%xtb_parameter => xtb_parameter
3338 IF (
PRESENT(elec_conf))
THEN
3339 IF (
ASSOCIATED(qs_kind%elec_conf))
THEN
3340 DEALLOCATE (qs_kind%elec_conf)
3342 ALLOCATE (qs_kind%elec_conf(0:
SIZE(elec_conf) - 1))
3343 qs_kind%elec_conf(:) = elec_conf(:)
3345 IF (
PRESENT(paw_atom)) qs_kind%paw_atom = paw_atom
3346 IF (
PRESENT(hard_radius)) qs_kind%hard_radius = hard_radius
3347 IF (
PRESENT(hard0_radius)) qs_kind%hard0_radius = hard0_radius
3348 IF (
PRESENT(covalent_radius)) qs_kind%covalent_radius = covalent_radius
3349 IF (
PRESENT(vdw_radius)) qs_kind%vdw_radius = vdw_radius
3350 IF (
PRESENT(lmax_rho0)) qs_kind%lmax_rho0 = lmax_rho0
3351 IF (
PRESENT(zeff))
THEN
3352 IF (
ASSOCIATED(qs_kind%all_potential))
THEN
3353 CALL set_potential(potential=qs_kind%all_potential, zeff=zeff)
3354 ELSE IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
3355 CALL set_potential(potential=qs_kind%gth_potential, zeff=zeff)
3356 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
3357 CALL set_potential(potential=qs_kind%sgp_potential, zeff=zeff)
3358 ELSE IF (
ASSOCIATED(qs_kind%cneo_potential))
THEN
3359 cpabort(
"CNEO potential ZEFF should not be manually set")
3362 IF (
PRESENT(ghost)) qs_kind%ghost = ghost
3364 IF (
PRESENT(floating)) qs_kind%floating = floating
3366 IF (
PRESENT(no_optimize)) qs_kind%no_optimize = no_optimize
3368 IF (
PRESENT(dispersion)) qs_kind%dispersion => dispersion
3370 IF (
PRESENT(u_minus_j))
THEN
3371 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
3372 qs_kind%dft_plus_u%u_minus_j = u_minus_j
3376 IF (
PRESENT(hund_j))
THEN
3377 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
3378 qs_kind%dft_plus_u%hund_j = hund_j
3382 IF (
PRESENT(reltmat)) qs_kind%reltmat => reltmat
3384 IF (
PRESENT(pao_basis_size)) qs_kind%pao_basis_size = pao_basis_size
3396 SUBROUTINE write_qs_kind(qs_kind, kind_number, output_unit)
3399 INTEGER,
INTENT(in) :: kind_number, output_unit
3401 CHARACTER(LEN=3) :: yon
3402 CHARACTER(LEN=default_string_length) :: basis_type, bstring
3407 IF (output_unit > 0)
THEN
3409 IF (
ASSOCIATED(qs_kind))
THEN
3410 WRITE (unit=output_unit, fmt=
"(/,T2,I2,A,T57,A,T75,I6)") &
3411 kind_number,
". Atomic kind: "//trim(qs_kind%name), &
3412 "Number of atoms: ", qs_kind%natom
3414 DO ibas = 1,
SIZE(qs_kind%basis_sets, 1)
3417 inumbas=ibas, basis_type=basis_type)
3419 SELECT CASE (basis_type)
3421 bstring =
"Basis Set"
3424 bstring =
"Orbital Basis Set"
3426 bstring =
"GAPW Soft Basis Set"
3429 bstring =
"Auxiliary Basis Set"
3431 bstring =
"Minimal Basis Set"
3433 bstring =
"RI Auxiliary Basis Set"
3435 bstring =
"Auxiliary Fit Basis Set"
3437 bstring =
"LRI Basis Set"
3439 bstring =
"LRI Basis Set for TDDFPT"
3441 bstring =
"RI XAS Basis Set"
3443 bstring =
"RI HFX Basis Set"
3445 bstring =
"Nuclear Basis Set"
3448 bstring =
"Nuclear Soft Basis Set"
3458 IF (qs_kind%ghost)
THEN
3459 WRITE (unit=output_unit, fmt=
"(/,T6,A)") &
3460 "The atoms of this atomic kind are GHOST atoms!"
3462 IF (qs_kind%monovalent)
THEN
3463 WRITE (unit=output_unit, fmt=
"(/,T6,A)") &
3464 "The atoms of this atomic kind are MONOVALENT!"
3466 IF (qs_kind%floating)
THEN
3467 WRITE (unit=output_unit, fmt=
"(/,T6,A)") &
3468 "The atoms of this atomic kind are FLOATING BASIS FUNCTIONS."
3470 IF (qs_kind%covalent_radius > 0.0_dp)
THEN
3471 WRITE (unit=output_unit, fmt=
"(/,T8,A,T71,F10.3)") &
3472 "Atomic covalent radius [Angstrom]:", &
3475 IF (qs_kind%vdw_radius > 0.0_dp)
THEN
3476 WRITE (unit=output_unit, fmt=
"(/,T8,A,T71,F10.3)") &
3477 "Atomic van der Waals radius [Angstrom]:", &
3480 IF (qs_kind%paw_atom)
THEN
3481 WRITE (unit=output_unit, fmt=
"(/,T6,A)") &
3482 "The atoms of this atomic kind are PAW atoms (GAPW):"
3483 WRITE (unit=output_unit, fmt=
"(T8,A,T71,F10.3)") &
3484 "Hard Gaussian function radius:", qs_kind%hard_radius, &
3485 "Rho0 radius:", qs_kind%hard0_radius, &
3486 "Maximum GTO radius used for PAW projector construction:", &
3487 qs_kind%max_rad_local
3490 basis_type=
"ORB_SOFT")
3494 IF (
ASSOCIATED(qs_kind%all_potential))
CALL write_potential(qs_kind%all_potential, output_unit)
3495 IF (
ASSOCIATED(qs_kind%gth_potential))
CALL write_potential(qs_kind%gth_potential, output_unit)
3496 IF (
ASSOCIATED(qs_kind%sgp_potential))
CALL write_potential(qs_kind%sgp_potential, output_unit)
3497 IF (
ASSOCIATED(qs_kind%tnadd_potential))
CALL write_potential(qs_kind%tnadd_potential, output_unit)
3498 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
3499 WRITE (unit=output_unit, fmt=
"(/,T6,A,/,T8,A,T76,I5,/,T8,A,T73,F8.3,/,T8,A,T73,F8.3)") &
3500 "A DFT+U correction is applied to atoms of this atomic kind:", &
3501 "Angular quantum momentum number L:", qs_kind%dft_plus_u%l, &
3502 "U(eff) = (U - J) value in [eV]:", qs_kind%dft_plus_u%u_minus_j_target*
evolt, &
3503 "Hund J value in [eV]:", qs_kind%dft_plus_u%hund_j*
evolt
3504 IF (qs_kind%dft_plus_u%u_ramping > 0.0_dp)
THEN
3505 IF (qs_kind%dft_plus_u%init_u_ramping_each_scf)
THEN
3510 WRITE (unit=output_unit, fmt=
"(T8,A,T73,F8.3,/,T8,A,T73,ES8.1,/,T8,A,T78,A3)") &
3511 "Increment for U ramping in [eV]:", qs_kind%dft_plus_u%u_ramping*
evolt, &
3512 "SCF threshold value for U ramping:", qs_kind%dft_plus_u%eps_u_ramping, &
3513 "Set U ramping value to zero before each wavefunction optimisation:", yon
3515 IF (
ASSOCIATED(qs_kind%dft_plus_u%orbitals))
THEN
3516 WRITE (unit=output_unit, fmt=
"(T8,A)") &
3517 "An initial orbital occupation is requested:"
3518 IF (
ASSOCIATED(qs_kind%dft_plus_u%nelec))
THEN
3519 IF (any(qs_kind%dft_plus_u%nelec(:) >= 0.5_dp))
THEN
3520 IF (
SIZE(qs_kind%dft_plus_u%nelec) > 1)
THEN
3521 WRITE (unit=output_unit, fmt=
"(T9,A,T75,F6.2)") &
3522 "Number of alpha electrons:", &
3523 qs_kind%dft_plus_u%nelec(1), &
3524 "Number of beta electrons:", &
3525 qs_kind%dft_plus_u%nelec(2)
3527 WRITE (unit=output_unit, fmt=
"(T9,A,T75,F6.2)") &
3528 "Number of electrons:", &
3529 qs_kind%dft_plus_u%nelec(1)
3533 WRITE (unit=output_unit, fmt=
"(T9,A,(T78,I3))") &
3534 "Preferred (initial) orbital occupation order (orbital M values):", &
3535 qs_kind%dft_plus_u%orbitals(:)
3536 WRITE (unit=output_unit, fmt=
"(T9,A,T71,ES10.3,/,T9,A,T76,I5)") &
3537 "Threshold value for the SCF convergence criterion:", &
3538 qs_kind%dft_plus_u%eps_scf, &
3539 "Number of initial SCF iterations:", &
3540 qs_kind%dft_plus_u%max_scf
3541 IF (qs_kind%dft_plus_u%smear)
THEN
3542 WRITE (unit=output_unit, fmt=
"(T9,A)") &
3543 "A smearing of the orbital occupations will be performed"
3547 IF (
ASSOCIATED(qs_kind%cneo_potential))
THEN
3548 WRITE (unit=output_unit, fmt=
"(/,T6,A)") &
3549 "The nuclei of this atomic kind are quantum mechanical (CNEO)"
3557 basis_type=
"NUC_SOFT")
3561 cpabort(
"write_qs_kind requires qs_kind to be associated")
3566 END SUBROUTINE write_qs_kind
3576 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
3579 CHARACTER(len=*),
PARAMETER :: routinen =
'write_qs_kind_set'
3581 INTEGER :: handle, ikind, nkind, output_unit
3585 CALL timeset(routinen, handle)
3590 "PRINT%KINDS", extension=
".Log")
3591 IF (output_unit > 0)
THEN
3592 IF (
ASSOCIATED(qs_kind_set))
THEN
3593 WRITE (unit=output_unit, fmt=
"(/,/,T2,A)")
"ATOMIC KIND INFORMATION"
3594 nkind =
SIZE(qs_kind_set)
3596 qs_kind => qs_kind_set(ikind)
3597 CALL write_qs_kind(qs_kind, ikind, output_unit)
3600 cpabort(
"write_qs_kind_set requires qs_kind_set to be associated")
3607 CALL timestop(handle)
3622 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
3625 CHARACTER(LEN=*),
PARAMETER :: routinen =
'write_gto_basis_sets'
3627 CHARACTER(LEN=default_string_length) :: basis_type, bstring
3628 INTEGER :: handle, ibas, ikind, nkind, output_unit
3633 CALL timeset(routinen, handle)
3638 "PRINT%KINDS/BASIS_SET", &
3640 IF (output_unit > 0)
THEN
3641 IF (
ASSOCIATED(qs_kind_set))
THEN
3642 WRITE (unit=output_unit, fmt=
"(/,/,T2,A)") &
3643 "BASIS SET INFORMATION (Unnormalised Gaussian-type functions)"
3644 nkind =
SIZE(qs_kind_set)
3646 qs_kind => qs_kind_set(ikind)
3647 WRITE (unit=output_unit, fmt=
"(/,T2,I2,A)") &
3648 ikind,
". Atomic kind: "//trim(qs_kind%name)
3650 DO ibas = 1,
SIZE(qs_kind%basis_sets, 1)
3653 inumbas=ibas, basis_type=basis_type)
3654 IF (basis_type ==
"") cycle
3655 SELECT CASE (basis_type)
3657 bstring =
"Basis Set"
3659 bstring =
"Orbital Basis Set"
3661 bstring =
"GAPW Soft Basis Set"
3663 bstring =
"Auxiliary Basis Set"
3665 bstring =
"Minimal Basis Set"
3667 bstring =
"RI Auxiliary Basis Set"
3669 bstring =
"Auxiliary Fit Basis Set"
3671 bstring =
"LRI Basis Set"
3673 bstring =
"LRI Basis Set for TDDFPT"
3675 bstring =
"RI HFX Basis Set"
3677 bstring =
"Nuclear Basis Set"
3678 IF (.NOT.
ASSOCIATED(qs_kind%cneo_potential))
NULLIFY (tmp_basis)
3680 bstring =
"Nuclear Soft Basis Set"
3681 IF (.NOT.
ASSOCIATED(qs_kind%cneo_potential))
NULLIFY (tmp_basis)
3690 cpabort(
"write_gto_basis_sets require qs_kind_set to be associated")
3695 "PRINT%KINDS/BASIS_SET")
3697 CALL timestop(handle)
3715 INTEGER,
DIMENSION(0:lmat, 10),
INTENT(OUT) :: ncalc, ncore,
nelem
3716 REAL(kind=
dp),
DIMENSION(0:lmat, 10, 2), &
3717 INTENT(OUT) :: edelta
3718 LOGICAL,
INTENT(IN),
OPTIONAL :: rks
3720 INTEGER :: i, ii, is, l, ll, ne, nn, z
3721 INTEGER,
DIMENSION(:),
POINTER :: econf
3722 INTEGER,
DIMENSION(:, :),
POINTER :: addel, laddel, naddel
3723 LOGICAL :: bs_occupation, monovalent
3724 REAL(kind=
dp) :: dmag, magnetization
3729 NULLIFY (gth_potential)
3731 gth_potential=gth_potential, &
3732 sgp_potential=sgp_potential, &
3733 magnetization=magnetization, &
3734 bs_occupation=bs_occupation, &
3735 monovalent=monovalent, &
3736 addel=addel, laddel=laddel, naddel=naddel)
3738 IF (
PRESENT(rks))
THEN
3740 magnetization = 0.0_dp
3741 bs_occupation = .false.
3750 IF (monovalent)
THEN
3753 ELSE IF (
ASSOCIATED(gth_potential))
THEN
3756 ELSE IF (
ASSOCIATED(sgp_potential))
THEN
3760 DO l = 0, min(
lmat, ubound(
ptable(z)%e_conv, 1))
3775 ncalc =
nelem - ncore
3781 IF (bs_occupation)
THEN
3783 DO i = 1,
SIZE(addel, 1)
3786 nn = naddel(i, is) - l
3789 DO ii =
SIZE(
nelem, 2), 1, -1
3790 IF (ncalc(l, ii) > 0)
THEN
3791 IF ((ncalc(l, ii) + ne) < 2*(2*l + 1) + 1)
THEN
3792 edelta(l, ii, is) = edelta(l, ii, is) + ne
3795 edelta(l, ii + 1, is) = edelta(l, ii + 1, is) + ne
3799 ELSE IF (ii == 1)
THEN
3800 edelta(l, ii, is) = edelta(l, ii, is) + ne
3805 edelta(l, nn, is) = edelta(l, nn, is) + ne
3807 IF (ncalc(l, nn) + edelta(l, nn, is) < 0)
THEN
3808 edelta(l, nn, is) = -ncalc(l, nn)
3813 edelta = 0.5_dp*edelta
3814 ELSE IF (magnetization /= 0.0_dp)
THEN
3815 dmag = 0.5_dp*abs(magnetization)
3816 DO l = 0, min(
lmat, ubound(
ptable(z)%e_conv, 1))
3819 DO i = 1,
SIZE(ncalc, 2)
3820 IF (ncalc(l, i) == 0) cycle
3821 IF (ncalc(l, i) == ll) cycle
3822 IF (ncalc(l, i) > dmag .AND. (ll - ncalc(l, i)) > dmag)
THEN
3828 edelta(l, ii, 1) = magnetization*0.5_dp
3829 edelta(l, ii, 2) = -magnetization*0.5_dp
3834 CALL cp_abort(__location__, &
3835 "Magnetization value cannot be imposed for this atom type")
3839 IF (qs_kind%ghost .OR. qs_kind%floating)
THEN
3857 INTEGER,
DIMENSION(:),
POINTER :: econf
3858 INTEGER,
INTENT(IN) :: z
3859 INTEGER,
DIMENSION(0:lmat, 10),
INTENT(OUT) :: ncalc, ncore,
nelem
3861 CHARACTER(LEN=default_string_length) :: message
3862 INTEGER :: ii, iounit, l, ll, lmin, nc, nn
3863 INTEGER,
DIMENSION(0:lmat) :: econfx
3871 econfx(0:
SIZE(econf) - 1) = econf
3872 IF (sum(econf) >= 0)
THEN
3873 lmin = min(
lmat, ubound(
ptable(z)%e_conv, 1))
4184 IF (z == 65 .AND. econfx(3) == 0)
THEN
4190 IF (ncore(0, 1) <= 0)
THEN
4191 IF (z >= 58 .AND. z <= 71)
THEN
4204 ncore(3, 1) = nc - 28
4205 message =
"A small-core pseudopotential with 4f-in-core is used for the lanthanide "// &
4207 cphint(trim(message))
4218 ncore(3, 1) = nc - 46
4219 message =
"A medium-core pseudopotential with 4f-in-core is used for the lanthanide "// &
4221 cphint(trim(message))
4228 IF (ncore(0, 1) >= 0)
THEN
4231 nn = sum(ncore(l, :)) + econfx(l)
4244 ncalc =
nelem - ncore
4247 IF (iounit > 0)
THEN
4248 WRITE (iounit,
"(/,A,A2)")
"WARNING: Core states irregular for atom type ",
ptable(z)%symbol
4249 WRITE (iounit,
"(A,10I3)")
"WARNING: Redefine ELEC_CONF in the KIND section"
4250 cpabort(
"Incompatible Atomic Occupations Detected")
4254 lmin = min(
lmat, ubound(
ptable(z)%e_conv, 1))
4288 LOGICAL :: nlcc_present
4294 DO ikind = 1,
SIZE(qs_kind_set)
4295 CALL get_qs_kind(qs_kind_set(ikind), gth_potential=gth_potential, sgp_potential=sgp_potential)
4296 IF (
ASSOCIATED(gth_potential))
THEN
4297 CALL get_potential(potential=gth_potential, nlcc_present=nlcc_present)
4298 nlcc = nlcc .OR. nlcc_present
4299 ELSE IF (
ASSOCIATED(sgp_potential))
THEN
4301 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.
pure subroutine, public atom_release_upf(upfpot)
...
subroutine, public atom_read_upf(pot, upf_filename, read_header, read_augmentation)
...
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 create_gto_from_sto_basis(sto_basis_set, gto_basis_set, ngauss, ortho, ngaussflex)
...
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 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...
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...
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, file_access)
...
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 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, ngauss, electronegativity, chmax, en, kqat2, kcn, kq)
...
subroutine, public deallocate_xtb_atom_param(xtb_parameter)
...
subroutine, public write_xtb_atom_param(xtb_parameter, gfn_type, subsys_section)
...
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.