36 basis_set_container_type,&
56 all_potential_type, allocate_potential, deallocate_potential, get_potential, &
57 gth_potential_type, init_potential, local_potential_type, read_potential, &
101 semi_empirical_type,&
112 #include "./base/base_uses.f90"
120 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_kind_types'
128 INTEGER :: max_scf = -1
129 REAL(KIND=
dp) :: eps_u_ramping = 0.0_dp
130 REAL(KIND=
dp) :: eps_scf = huge(0.0_dp)
131 REAL(KIND=
dp) :: u_minus_j_target
132 REAL(KIND=
dp) :: u_minus_j = 0.0_dp
133 REAL(KIND=
dp) :: u_ramping = 0.0_dp
134 REAL(KIND=
dp) :: u = 0.0_dp
135 REAL(KIND=
dp) :: j = 0.0_dp
136 REAL(KIND=
dp) :: alpha = 0.0_dp
137 REAL(KIND=
dp) :: beta = 0.0_dp
138 REAL(KIND=
dp) :: j0 = 0.0_dp
139 REAL(KIND=
dp) :: occupation = -1.0_dp
140 INTEGER,
DIMENSION(:),
POINTER :: orbitals => null()
141 LOGICAL :: init_u_ramping_each_scf = .false.
142 LOGICAL :: smear = .false.
143 REAL(KIND=
dp),
DIMENSION(:),
POINTER :: nelec => null()
144 END TYPE dft_plus_u_type
149 TYPE pao_potential_type
151 REAL(KIND=
dp) :: beta = 0.0_dp
152 REAL(KIND=
dp) :: weight = 0.0_dp
153 INTEGER :: max_projector = -1
154 REAL(KIND=
dp) :: beta_radius = huge(
dp)
155 END TYPE pao_potential_type
160 TYPE pao_descriptor_type
161 REAL(KIND=
dp) :: beta = 0.0_dp
162 REAL(KIND=
dp) :: beta_radius = huge(
dp)
163 REAL(KIND=
dp) :: weight = 0.0_dp
164 REAL(KIND=
dp) :: screening = 0.0_dp
165 REAL(KIND=
dp) :: screening_radius = huge(
dp)
166 END TYPE pao_descriptor_type
172 CHARACTER(LEN=default_string_length) :: name =
""
173 CHARACTER(LEN=2) :: element_symbol =
""
174 INTEGER :: natom = -1
175 TYPE(all_potential_type),
POINTER :: all_potential => null()
176 TYPE(local_potential_type),
POINTER :: tnadd_potential => null()
177 TYPE(gth_potential_type),
POINTER :: gth_potential => null()
178 TYPE(sgp_potential_type),
POINTER :: sgp_potential => null()
179 TYPE(semi_empirical_type),
POINTER :: se_parameter => null()
180 TYPE(qs_dftb_atom_type),
POINTER :: dftb_parameter => null()
181 TYPE(xtb_atom_type),
POINTER :: xtb_parameter => null()
183 TYPE(atom_upfpot_type),
POINTER :: upf_potential => null()
185 TYPE(basis_set_container_type), &
186 DIMENSION(20) :: basis_sets
188 REAL(KIND=
dp) :: covalent_radius = 0.0_dp
189 REAL(KIND=
dp) :: vdw_radius = 0.0_dp
191 TYPE(paw_proj_set_type),
POINTER :: paw_proj_set => null()
192 REAL(KIND=
dp) :: hard_radius = 0.8_dp*
bohr
193 REAL(KIND=
dp) :: hard0_radius = 0.8_dp*
bohr
194 REAL(KIND=
dp) :: max_rad_local = 13.2_dp*
bohr
195 LOGICAL :: paw_atom = .false.
196 LOGICAL :: gpw_r3d_rs_type_forced = .false.
198 LOGICAL :: ghost = .false.
199 LOGICAL :: floating = .false.
200 INTEGER :: lmax_dftb = -1
201 REAL(KIND=
dp) :: dudq_dftb3 = 0.0_dp
202 REAL(KIND=
dp) :: magnetization = 0.0_dp
203 INTEGER,
DIMENSION(:, :),
POINTER :: addel => null()
204 INTEGER,
DIMENSION(:, :),
POINTER :: laddel => null()
205 INTEGER,
DIMENSION(:, :),
POINTER :: naddel => null()
206 TYPE(harmonics_atom_type),
POINTER :: harmonics => null()
207 TYPE(grid_atom_type),
POINTER :: grid_atom => null()
208 INTEGER :: ngrid_rad = 50
209 INTEGER :: ngrid_ang = 50
210 INTEGER :: lmax_rho0 = 0
212 INTEGER,
DIMENSION(:),
POINTER :: elec_conf => null()
213 LOGICAL :: bs_occupation = .false.
214 TYPE(dft_plus_u_type),
POINTER :: dft_plus_u => null()
215 LOGICAL :: no_optimize = .true.
217 REAL(KIND=
dp),
DIMENSION(:, :),
POINTER :: nlcc_pot => null()
219 TYPE(qs_atom_dispersion_type),
POINTER :: dispersion => null()
220 REAL(KIND=
dp),
DIMENSION(:, :),
POINTER :: reltmat => null()
221 INTEGER :: pao_basis_size = -1
222 TYPE(pao_potential_type),
DIMENSION(:),
POINTER :: pao_potentials => null()
223 TYPE(pao_descriptor_type),
DIMENSION(:),
POINTER :: pao_descriptors => null()
224 END TYPE qs_kind_type
230 TYPE(qs_kind_type),
DIMENSION(:), &
231 POINTER :: qs_kind_set
232 END TYPE qs_kind_p_type
251 PUBLIC :: qs_kind_type, pao_potential_type, pao_descriptor_type
264 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
266 INTEGER :: ikind, nkind
268 IF (
ASSOCIATED(qs_kind_set))
THEN
270 nkind =
SIZE(qs_kind_set)
273 IF (
ASSOCIATED(qs_kind_set(ikind)%all_potential))
THEN
274 CALL deallocate_potential(qs_kind_set(ikind)%all_potential)
276 IF (
ASSOCIATED(qs_kind_set(ikind)%tnadd_potential))
THEN
277 CALL deallocate_potential(qs_kind_set(ikind)%tnadd_potential)
279 IF (
ASSOCIATED(qs_kind_set(ikind)%gth_potential))
THEN
280 CALL deallocate_potential(qs_kind_set(ikind)%gth_potential)
282 IF (
ASSOCIATED(qs_kind_set(ikind)%sgp_potential))
THEN
283 CALL deallocate_potential(qs_kind_set(ikind)%sgp_potential)
285 IF (
ASSOCIATED(qs_kind_set(ikind)%upf_potential))
THEN
287 DEALLOCATE (qs_kind_set(ikind)%upf_potential)
289 IF (
ASSOCIATED(qs_kind_set(ikind)%se_parameter))
THEN
292 IF (
ASSOCIATED(qs_kind_set(ikind)%dftb_parameter))
THEN
295 IF (
ASSOCIATED(qs_kind_set(ikind)%xtb_parameter))
THEN
298 IF (
ASSOCIATED(qs_kind_set(ikind)%paw_proj_set))
THEN
301 IF (
ASSOCIATED(qs_kind_set(ikind)%harmonics))
THEN
304 IF (
ASSOCIATED(qs_kind_set(ikind)%grid_atom))
THEN
307 IF (
ASSOCIATED(qs_kind_set(ikind)%elec_conf))
THEN
308 DEALLOCATE (qs_kind_set(ikind)%elec_conf)
311 IF (
ASSOCIATED(qs_kind_set(ikind)%dft_plus_u))
THEN
312 IF (
ASSOCIATED(qs_kind_set(ikind)%dft_plus_u%orbitals))
THEN
313 DEALLOCATE (qs_kind_set(ikind)%dft_plus_u%orbitals)
315 IF (
ASSOCIATED(qs_kind_set(ikind)%dft_plus_u%nelec))
THEN
316 DEALLOCATE (qs_kind_set(ikind)%dft_plus_u%nelec)
318 DEALLOCATE (qs_kind_set(ikind)%dft_plus_u)
321 IF (
ASSOCIATED(qs_kind_set(ikind)%nlcc_pot))
THEN
322 DEALLOCATE (qs_kind_set(ikind)%nlcc_pot)
325 IF (
ASSOCIATED(qs_kind_set(ikind)%dispersion))
THEN
326 DEALLOCATE (qs_kind_set(ikind)%dispersion)
328 IF (
ASSOCIATED(qs_kind_set(ikind)%addel))
THEN
329 DEALLOCATE (qs_kind_set(ikind)%addel)
331 IF (
ASSOCIATED(qs_kind_set(ikind)%naddel))
THEN
332 DEALLOCATE (qs_kind_set(ikind)%naddel)
334 IF (
ASSOCIATED(qs_kind_set(ikind)%laddel))
THEN
335 DEALLOCATE (qs_kind_set(ikind)%laddel)
337 IF (
ASSOCIATED(qs_kind_set(ikind)%reltmat))
THEN
338 DEALLOCATE (qs_kind_set(ikind)%reltmat)
341 IF (
ASSOCIATED(qs_kind_set(ikind)%pao_potentials))
THEN
342 DEALLOCATE (qs_kind_set(ikind)%pao_potentials)
344 IF (
ASSOCIATED(qs_kind_set(ikind)%pao_descriptors))
THEN
345 DEALLOCATE (qs_kind_set(ikind)%pao_descriptors)
351 DEALLOCATE (qs_kind_set)
353 CALL cp_abort(__location__, &
354 "The pointer qs_kind_set is not associated and "// &
355 "cannot be deallocated")
435 basis_set, basis_type, ncgf, nsgf, &
436 all_potential, tnadd_potential, gth_potential, sgp_potential, upf_potential, &
437 se_parameter, dftb_parameter, xtb_parameter, &
438 dftb3_param, zeff, elec_conf, mao, lmax_dftb, &
439 alpha_core_charge, ccore_charge, core_charge, core_charge_radius, &
440 paw_proj_set, paw_atom, hard_radius, hard0_radius, max_rad_local, &
441 covalent_radius, vdw_radius, &
442 gpw_r3d_rs_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, &
443 ngrid_ang, ngrid_rad, lmax_rho0, &
444 dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, &
445 u_minus_j, U_of_dft_plus_u, J_of_dft_plus_u, &
446 alpha_of_dft_plus_u, beta_of_dft_plus_u, J0_of_dft_plus_u, occupation_of_dft_plus_u, dispersion, &
447 bs_occupation, magnetization, no_optimize, addel, laddel, naddel, orbitals, &
448 max_scf, eps_scf, smear, u_ramping, u_minus_j_target, eps_u_ramping, &
449 init_u_ramping_each_scf, reltmat, ghost, floating, name, element_symbol, &
450 pao_basis_size, pao_potentials, pao_descriptors, nelec)
452 TYPE(qs_kind_type) :: qs_kind
453 TYPE(gto_basis_set_type),
OPTIONAL,
POINTER :: basis_set
454 CHARACTER(len=*),
OPTIONAL :: basis_type
455 INTEGER,
INTENT(OUT),
OPTIONAL :: ncgf, nsgf
456 TYPE(all_potential_type),
OPTIONAL,
POINTER :: all_potential
457 TYPE(local_potential_type),
OPTIONAL,
POINTER :: tnadd_potential
458 TYPE(gth_potential_type),
OPTIONAL,
POINTER :: gth_potential
459 TYPE(sgp_potential_type),
OPTIONAL,
POINTER :: sgp_potential
461 TYPE(semi_empirical_type),
OPTIONAL,
POINTER :: se_parameter
462 TYPE(qs_dftb_atom_type),
OPTIONAL,
POINTER :: dftb_parameter
463 TYPE(xtb_atom_type),
OPTIONAL,
POINTER :: xtb_parameter
464 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: dftb3_param, zeff
465 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: elec_conf
466 INTEGER,
INTENT(OUT),
OPTIONAL :: mao, lmax_dftb
467 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: alpha_core_charge, ccore_charge, &
468 core_charge, core_charge_radius
469 TYPE(paw_proj_set_type),
OPTIONAL,
POINTER :: paw_proj_set
470 LOGICAL,
INTENT(OUT),
OPTIONAL :: paw_atom
471 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: hard_radius, hard0_radius, &
472 max_rad_local, covalent_radius, &
474 LOGICAL,
INTENT(OUT),
OPTIONAL :: gpw_r3d_rs_type_forced
475 TYPE(harmonics_atom_type),
OPTIONAL,
POINTER :: harmonics
476 INTEGER,
INTENT(OUT),
OPTIONAL :: max_iso_not0, max_s_harm
477 TYPE(grid_atom_type),
OPTIONAL,
POINTER :: grid_atom
478 INTEGER,
INTENT(OUT),
OPTIONAL :: ngrid_ang, ngrid_rad, lmax_rho0
479 LOGICAL,
INTENT(OUT),
OPTIONAL :: dft_plus_u_atom
480 INTEGER,
INTENT(OUT),
OPTIONAL :: l_of_dft_plus_u, n_of_dft_plus_u
481 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: u_minus_j, u_of_dft_plus_u, j_of_dft_plus_u, &
482 alpha_of_dft_plus_u, beta_of_dft_plus_u, j0_of_dft_plus_u, occupation_of_dft_plus_u
483 TYPE(qs_atom_dispersion_type),
OPTIONAL,
POINTER :: dispersion
484 LOGICAL,
INTENT(OUT),
OPTIONAL :: bs_occupation
485 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: magnetization
486 LOGICAL,
INTENT(OUT),
OPTIONAL :: no_optimize
487 INTEGER,
DIMENSION(:, :),
OPTIONAL,
POINTER :: addel, laddel, naddel
488 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: orbitals
489 INTEGER,
OPTIONAL :: max_scf
490 REAL(kind=
dp),
OPTIONAL :: eps_scf
491 LOGICAL,
OPTIONAL :: smear
492 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: u_ramping, u_minus_j_target, &
494 LOGICAL,
OPTIONAL :: init_u_ramping_each_scf
495 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: reltmat
496 LOGICAL,
OPTIONAL :: ghost, floating
497 CHARACTER(LEN=default_string_length), &
498 INTENT(OUT),
OPTIONAL :: name
499 CHARACTER(LEN=2),
INTENT(OUT),
OPTIONAL :: element_symbol
500 INTEGER,
INTENT(OUT),
OPTIONAL :: pao_basis_size
501 TYPE(pao_potential_type),
DIMENSION(:),
OPTIONAL, &
503 TYPE(pao_descriptor_type),
DIMENSION(:), &
504 OPTIONAL,
POINTER :: pao_descriptors
505 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: nelec
507 CHARACTER(LEN=default_string_length) :: my_basis_type
509 TYPE(gto_basis_set_type),
POINTER :: tmp_basis_set
512 IF (
PRESENT(basis_type))
THEN
513 my_basis_type = basis_type
515 my_basis_type =
"ORB"
518 IF (
PRESENT(basis_set))
THEN
520 basis_type=my_basis_type)
523 IF (
PRESENT(ncgf))
THEN
525 basis_type=my_basis_type)
526 IF (
ASSOCIATED(tmp_basis_set))
THEN
528 ELSE IF (
ASSOCIATED(qs_kind%dftb_parameter))
THEN
529 l = qs_kind%dftb_parameter%lmax
530 ncgf = ((l + 1)*(l + 2)*(l + 3))/6
536 IF (
PRESENT(nsgf))
THEN
538 basis_type=my_basis_type)
539 IF (
ASSOCIATED(tmp_basis_set))
THEN
541 ELSE IF (
ASSOCIATED(qs_kind%dftb_parameter))
THEN
542 nsgf = qs_kind%dftb_parameter%natorb
548 IF (
PRESENT(all_potential)) all_potential => qs_kind%all_potential
549 IF (
PRESENT(tnadd_potential)) tnadd_potential => qs_kind%tnadd_potential
550 IF (
PRESENT(gth_potential)) gth_potential => qs_kind%gth_potential
551 IF (
PRESENT(sgp_potential)) sgp_potential => qs_kind%sgp_potential
552 IF (
PRESENT(upf_potential)) upf_potential => qs_kind%upf_potential
553 IF (
PRESENT(se_parameter)) se_parameter => qs_kind%se_parameter
554 IF (
PRESENT(dftb_parameter)) dftb_parameter => qs_kind%dftb_parameter
555 IF (
PRESENT(xtb_parameter)) xtb_parameter => qs_kind%xtb_parameter
557 IF (
PRESENT(element_symbol)) element_symbol = qs_kind%element_symbol
558 IF (
PRESENT(name)) name = qs_kind%name
559 IF (
PRESENT(dftb3_param)) dftb3_param = qs_kind%dudq_dftb3
560 IF (
PRESENT(elec_conf)) elec_conf => qs_kind%elec_conf
561 IF (
PRESENT(alpha_core_charge))
THEN
562 IF (
ASSOCIATED(qs_kind%all_potential))
THEN
563 CALL get_potential(potential=qs_kind%all_potential, &
564 alpha_core_charge=alpha_core_charge)
565 ELSE IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
566 CALL get_potential(potential=qs_kind%gth_potential, &
567 alpha_core_charge=alpha_core_charge)
568 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
569 CALL get_potential(potential=qs_kind%sgp_potential, &
570 alpha_core_charge=alpha_core_charge)
572 alpha_core_charge = 1.0_dp
575 IF (
PRESENT(ccore_charge))
THEN
576 IF (
ASSOCIATED(qs_kind%all_potential))
THEN
577 CALL get_potential(potential=qs_kind%all_potential, &
578 ccore_charge=ccore_charge)
579 ELSE IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
580 CALL get_potential(potential=qs_kind%gth_potential, &
581 ccore_charge=ccore_charge)
582 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
583 CALL get_potential(potential=qs_kind%sgp_potential, &
584 ccore_charge=ccore_charge)
585 ELSE IF (
ASSOCIATED(qs_kind%upf_potential))
THEN
586 cpabort(
"UPF CCORE CHARGE RADIUS NOT AVAILABLE")
588 ccore_charge = 0.0_dp
591 IF (
PRESENT(core_charge_radius))
THEN
592 IF (
ASSOCIATED(qs_kind%all_potential))
THEN
593 CALL get_potential(potential=qs_kind%all_potential, &
594 core_charge_radius=core_charge_radius)
595 ELSE IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
596 CALL get_potential(potential=qs_kind%gth_potential, &
597 core_charge_radius=core_charge_radius)
598 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
599 CALL get_potential(potential=qs_kind%sgp_potential, &
600 core_charge_radius=core_charge_radius)
601 ELSE IF (
ASSOCIATED(qs_kind%upf_potential))
THEN
602 cpabort(
"UPF CORE CHARGE RADIUS NOT AVAILABLE")
604 core_charge_radius = 0.0_dp
607 IF (
PRESENT(core_charge))
THEN
608 IF (
ASSOCIATED(qs_kind%all_potential))
THEN
609 CALL get_potential(potential=qs_kind%all_potential, &
611 ELSE IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
612 CALL get_potential(potential=qs_kind%gth_potential, &
614 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
615 CALL get_potential(potential=qs_kind%sgp_potential, &
617 ELSE IF (
ASSOCIATED(qs_kind%upf_potential))
THEN
618 cpabort(
"UPF CORE CHARGE NOT AVAILABLE")
624 IF (
PRESENT(zeff))
THEN
625 IF (
ASSOCIATED(qs_kind%all_potential))
THEN
626 CALL get_potential(potential=qs_kind%all_potential, zeff=zeff)
627 ELSE IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
628 CALL get_potential(potential=qs_kind%gth_potential, zeff=zeff)
629 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
630 CALL get_potential(potential=qs_kind%sgp_potential, zeff=zeff)
631 ELSE IF (
ASSOCIATED(qs_kind%upf_potential))
THEN
632 zeff = qs_kind%upf_potential%zion
638 IF (
PRESENT(covalent_radius)) covalent_radius = qs_kind%covalent_radius
639 IF (
PRESENT(vdw_radius)) vdw_radius = qs_kind%vdw_radius
641 IF (
PRESENT(paw_proj_set)) paw_proj_set => qs_kind%paw_proj_set
642 IF (
PRESENT(paw_atom)) paw_atom = qs_kind%paw_atom
643 IF (
PRESENT(gpw_r3d_rs_type_forced)) gpw_r3d_rs_type_forced = qs_kind%gpw_r3d_rs_type_forced
644 IF (
PRESENT(hard_radius)) hard_radius = qs_kind%hard_radius
645 IF (
PRESENT(hard0_radius)) hard0_radius = qs_kind%hard0_radius
646 IF (
PRESENT(max_rad_local)) max_rad_local = qs_kind%max_rad_local
647 IF (
PRESENT(harmonics)) harmonics => qs_kind%harmonics
648 IF (
PRESENT(max_s_harm))
THEN
649 IF (
ASSOCIATED(qs_kind%harmonics))
THEN
650 max_s_harm = qs_kind%harmonics%max_s_harm
655 IF (
PRESENT(max_iso_not0))
THEN
656 IF (
ASSOCIATED(qs_kind%harmonics))
THEN
657 max_iso_not0 = qs_kind%harmonics%max_iso_not0
662 IF (
PRESENT(grid_atom)) grid_atom => qs_kind%grid_atom
663 IF (
PRESENT(ngrid_ang)) ngrid_ang = qs_kind%ngrid_ang
664 IF (
PRESENT(ngrid_rad)) ngrid_rad = qs_kind%ngrid_rad
665 IF (
PRESENT(lmax_rho0)) lmax_rho0 = qs_kind%lmax_rho0
666 IF (
PRESENT(ghost)) ghost = qs_kind%ghost
667 IF (
PRESENT(floating)) floating = qs_kind%floating
668 IF (
PRESENT(dft_plus_u_atom)) dft_plus_u_atom =
ASSOCIATED(qs_kind%dft_plus_u)
669 IF (
PRESENT(l_of_dft_plus_u))
THEN
670 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
671 l_of_dft_plus_u = qs_kind%dft_plus_u%l
676 IF (
PRESENT(n_of_dft_plus_u))
THEN
677 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
678 n_of_dft_plus_u = qs_kind%dft_plus_u%n
683 IF (
PRESENT(u_minus_j))
THEN
684 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
685 u_minus_j = qs_kind%dft_plus_u%u_minus_j
690 IF (
PRESENT(u_minus_j_target))
THEN
691 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
692 u_minus_j_target = qs_kind%dft_plus_u%u_minus_j_target
694 u_minus_j_target = 0.0_dp
697 IF (
PRESENT(u_of_dft_plus_u))
THEN
698 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
699 u_of_dft_plus_u = qs_kind%dft_plus_u%U
701 u_of_dft_plus_u = 0.0_dp
704 IF (
PRESENT(j_of_dft_plus_u))
THEN
705 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
706 j_of_dft_plus_u = qs_kind%dft_plus_u%J
708 j_of_dft_plus_u = 0.0_dp
711 IF (
PRESENT(alpha_of_dft_plus_u))
THEN
712 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
713 alpha_of_dft_plus_u = qs_kind%dft_plus_u%alpha
715 alpha_of_dft_plus_u = 0.0_dp
718 IF (
PRESENT(beta_of_dft_plus_u))
THEN
719 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
720 beta_of_dft_plus_u = qs_kind%dft_plus_u%beta
722 beta_of_dft_plus_u = 0.0_dp
725 IF (
PRESENT(j0_of_dft_plus_u))
THEN
726 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
727 j0_of_dft_plus_u = qs_kind%dft_plus_u%J0
729 j0_of_dft_plus_u = 0.0_dp
732 IF (
PRESENT(occupation_of_dft_plus_u))
THEN
733 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
734 occupation_of_dft_plus_u = qs_kind%dft_plus_u%occupation
736 occupation_of_dft_plus_u = -1.0_dp
740 IF (
PRESENT(init_u_ramping_each_scf))
THEN
741 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
742 init_u_ramping_each_scf = qs_kind%dft_plus_u%init_u_ramping_each_scf
744 init_u_ramping_each_scf = .false.
747 IF (
PRESENT(u_ramping))
THEN
748 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
749 u_ramping = qs_kind%dft_plus_u%u_ramping
754 IF (
PRESENT(eps_u_ramping))
THEN
755 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
756 eps_u_ramping = qs_kind%dft_plus_u%eps_u_ramping
758 eps_u_ramping = 1.0e-5_dp
761 IF (
PRESENT(nelec))
THEN
763 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
764 IF (
ASSOCIATED(qs_kind%dft_plus_u%nelec))
THEN
765 nelec => qs_kind%dft_plus_u%nelec
769 IF (
PRESENT(orbitals))
THEN
771 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
772 IF (
ASSOCIATED(qs_kind%dft_plus_u%orbitals))
THEN
773 orbitals => qs_kind%dft_plus_u%orbitals
777 IF (
PRESENT(eps_scf))
THEN
778 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
779 eps_scf = qs_kind%dft_plus_u%eps_scf
784 IF (
PRESENT(max_scf))
THEN
785 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
786 max_scf = qs_kind%dft_plus_u%max_scf
791 IF (
PRESENT(smear))
THEN
792 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
793 smear = qs_kind%dft_plus_u%smear
798 IF (
PRESENT(dispersion)) dispersion => qs_kind%dispersion
799 IF (
PRESENT(bs_occupation)) bs_occupation = qs_kind%bs_occupation
800 IF (
PRESENT(addel)) addel => qs_kind%addel
801 IF (
PRESENT(laddel)) laddel => qs_kind%laddel
802 IF (
PRESENT(naddel)) naddel => qs_kind%naddel
804 IF (
PRESENT(magnetization)) magnetization = qs_kind%magnetization
806 IF (
PRESENT(no_optimize)) no_optimize = qs_kind%no_optimize
808 IF (
PRESENT(reltmat)) reltmat => qs_kind%reltmat
810 IF (
PRESENT(mao)) mao = qs_kind%mao
812 IF (
PRESENT(lmax_dftb)) lmax_dftb = qs_kind%lmax_dftb
814 IF (
PRESENT(pao_basis_size)) pao_basis_size = qs_kind%pao_basis_size
816 IF (
PRESENT(pao_descriptors)) pao_descriptors => qs_kind%pao_descriptors
857 all_potential_present, tnadd_potential_present, gth_potential_present, &
858 sgp_potential_present, paw_atom_present, dft_plus_u_atom_present, &
859 maxcgf, maxsgf, maxco, maxco_proj, maxgtops, maxlgto, maxlprj, maxnset, maxsgf_set, &
860 ncgf, npgf, nset, nsgf, nshell, maxpol, maxlppl, maxlppnl, maxppnl, &
861 nelectron, maxder, max_ngrid_rad, max_sph_harm, maxg_iso_not0, lmax_rho0, &
863 basis_type, total_zeff_corr)
865 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
866 LOGICAL,
INTENT(OUT),
OPTIONAL :: all_potential_present, tnadd_potential_present, &
867 gth_potential_present, sgp_potential_present, paw_atom_present, dft_plus_u_atom_present
868 INTEGER,
INTENT(OUT),
OPTIONAL :: maxcgf, maxsgf, maxco, maxco_proj, maxgtops, maxlgto, &
869 maxlprj, maxnset, maxsgf_set, ncgf, npgf, nset, nsgf, nshell, maxpol, maxlppl, maxlppnl, &
871 INTEGER,
INTENT(IN),
OPTIONAL :: maxder
872 INTEGER,
INTENT(OUT),
OPTIONAL :: max_ngrid_rad, max_sph_harm, &
873 maxg_iso_not0, lmax_rho0
874 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: basis_rcut
875 CHARACTER(len=*),
OPTIONAL :: basis_type
876 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: total_zeff_corr
878 CHARACTER(len=default_string_length) :: my_basis_type
879 INTEGER :: ikind,
imax, lmax_rho0_kind, &
880 max_iso_not0, max_s_harm, n, &
881 ngrid_rad, nkind, nrloc(10), &
883 LOGICAL :: dft_plus_u_atom, ecp_semi_local, paw_atom
884 REAL(kind=
dp) :: brcut, zeff, zeff_correction
885 TYPE(all_potential_type),
POINTER :: all_potential
886 TYPE(gth_potential_type),
POINTER :: gth_potential
887 TYPE(gto_basis_set_type),
POINTER :: tmp_basis_set
888 TYPE(local_potential_type),
POINTER :: tnadd_potential
889 TYPE(paw_proj_set_type),
POINTER :: paw_proj_set
890 TYPE(qs_dftb_atom_type),
POINTER :: dftb_parameter
891 TYPE(qs_kind_type),
POINTER :: qs_kind
892 TYPE(sgp_potential_type),
POINTER :: sgp_potential
894 IF (
PRESENT(basis_type))
THEN
895 my_basis_type = basis_type
897 my_basis_type =
"ORB"
900 IF (
ASSOCIATED(qs_kind_set))
THEN
902 IF (
PRESENT(maxcgf)) maxcgf = 0
903 IF (
PRESENT(maxco)) maxco = 0
904 IF (
PRESENT(maxco_proj)) maxco_proj = 0
905 IF (
PRESENT(maxg_iso_not0)) maxg_iso_not0 = 0
906 IF (
PRESENT(maxgtops)) maxgtops = 0
907 IF (
PRESENT(maxlgto)) maxlgto = -1
908 IF (
PRESENT(maxlppl)) maxlppl = -1
909 IF (
PRESENT(maxlppnl)) maxlppnl = -1
910 IF (
PRESENT(maxpol)) maxpol = -1
911 IF (
PRESENT(maxlprj)) maxlprj = -1
912 IF (
PRESENT(maxnset)) maxnset = 0
913 IF (
PRESENT(maxppnl)) maxppnl = 0
914 IF (
PRESENT(maxsgf)) maxsgf = 0
915 IF (
PRESENT(maxsgf_set)) maxsgf_set = 0
916 IF (
PRESENT(ncgf)) ncgf = 0
917 IF (
PRESENT(nelectron)) nelectron = 0
918 IF (
PRESENT(npgf)) npgf = 0
919 IF (
PRESENT(nset)) nset = 0
920 IF (
PRESENT(nsgf)) nsgf = 0
921 IF (
PRESENT(nshell)) nshell = 0
922 IF (
PRESENT(all_potential_present)) all_potential_present = .false.
923 IF (
PRESENT(tnadd_potential_present)) tnadd_potential_present = .false.
924 IF (
PRESENT(gth_potential_present)) gth_potential_present = .false.
925 IF (
PRESENT(sgp_potential_present)) sgp_potential_present = .false.
926 IF (
PRESENT(paw_atom_present)) paw_atom_present = .false.
927 IF (
PRESENT(max_ngrid_rad)) max_ngrid_rad = 0
928 IF (
PRESENT(max_sph_harm)) max_sph_harm = 0
929 IF (
PRESENT(lmax_rho0)) lmax_rho0 = 0
930 IF (
PRESENT(basis_rcut)) basis_rcut = 0.0_dp
931 IF (
PRESENT(total_zeff_corr)) total_zeff_corr = 0.0_dp
933 nkind =
SIZE(qs_kind_set)
935 qs_kind => qs_kind_set(ikind)
937 all_potential=all_potential, &
938 tnadd_potential=tnadd_potential, &
939 gth_potential=gth_potential, &
940 sgp_potential=sgp_potential, &
941 paw_proj_set=paw_proj_set, &
942 dftb_parameter=dftb_parameter, &
943 ngrid_rad=ngrid_rad, &
944 max_s_harm=max_s_harm, &
945 max_iso_not0=max_iso_not0, &
947 dft_plus_u_atom=dft_plus_u_atom, &
948 lmax_rho0=lmax_rho0_kind)
950 IF (
PRESENT(maxlppl) .AND.
ASSOCIATED(gth_potential))
THEN
951 CALL get_potential(potential=gth_potential, nexp_ppl=n)
952 maxlppl = max(maxlppl, 2*(n - 1))
953 ELSEIF (
PRESENT(maxlppl) .AND.
ASSOCIATED(sgp_potential))
THEN
954 CALL get_potential(potential=sgp_potential, nrloc=nrloc, ecp_semi_local=ecp_semi_local)
955 n = maxval(nrloc) - 2
956 maxlppl = max(maxlppl, 2*(n - 1))
957 IF (ecp_semi_local)
THEN
958 CALL get_potential(potential=sgp_potential, sl_lmax=
imax, nrpot=nrpot)
959 n = maxval(nrpot) - 2
961 maxlppl = max(maxlppl, n)
965 IF (
PRESENT(maxlppnl) .AND.
ASSOCIATED(gth_potential))
THEN
966 CALL get_potential(potential=gth_potential, lprj_ppnl_max=
imax)
967 maxlppnl = max(maxlppnl,
imax)
968 ELSEIF (
PRESENT(maxlppnl) .AND.
ASSOCIATED(sgp_potential))
THEN
969 CALL get_potential(potential=sgp_potential, lmax=
imax)
970 maxlppnl = max(maxlppnl,
imax)
973 IF (
PRESENT(maxpol) .AND.
ASSOCIATED(tnadd_potential))
THEN
974 CALL get_potential(potential=tnadd_potential, npol=n)
975 maxpol = max(maxpol, 2*(n - 1))
978 IF (
PRESENT(maxco_proj) .AND.
ASSOCIATED(paw_proj_set))
THEN
980 maxco_proj = max(maxco_proj,
imax)
983 IF (
PRESENT(maxlprj) .AND.
ASSOCIATED(paw_proj_set))
THEN
985 maxlprj = max(maxlprj,
imax)
988 IF (
PRESENT(maxppnl) .AND.
ASSOCIATED(gth_potential))
THEN
989 CALL get_potential(potential=gth_potential, nppnl=
imax)
990 maxppnl = max(maxppnl,
imax)
991 ELSEIF (
PRESENT(maxppnl) .AND.
ASSOCIATED(sgp_potential))
THEN
992 CALL get_potential(potential=sgp_potential, nppnl=
imax)
993 maxppnl = max(maxppnl,
imax)
997 basis_type=my_basis_type)
999 IF (
PRESENT(maxcgf))
THEN
1000 IF (
ASSOCIATED(tmp_basis_set))
THEN
1002 maxcgf = max(maxcgf,
imax)
1003 ELSE IF (
ASSOCIATED(qs_kind%dftb_parameter))
THEN
1006 maxcgf = max(maxcgf,
imax)
1010 IF (
PRESENT(maxco))
THEN
1011 IF (
ASSOCIATED(tmp_basis_set))
THEN
1012 IF (
PRESENT(maxder))
THEN
1014 maxco=
imax, maxder=maxder)
1018 maxco = max(maxco,
imax)
1020 IF (
ASSOCIATED(gth_potential))
THEN
1021 CALL get_potential(potential=gth_potential, lprj_ppnl_max=
imax)
1024 IF (
ASSOCIATED(sgp_potential))
THEN
1025 CALL get_potential(potential=sgp_potential, lmax=
imax)
1027 CALL get_potential(potential=sgp_potential, sl_lmax=
imax)
1032 IF (
PRESENT(maxgtops))
THEN
1033 IF (
ASSOCIATED(tmp_basis_set))
THEN
1035 maxgtops = max(maxgtops, n*
imax)
1039 IF (
PRESENT(maxlgto))
THEN
1040 IF (
ASSOCIATED(tmp_basis_set))
THEN
1042 maxlgto = max(maxlgto,
imax)
1043 ELSE IF (
ASSOCIATED(qs_kind%dftb_parameter))
THEN
1045 maxlgto = max(maxlgto,
imax)
1049 IF (
PRESENT(maxnset))
THEN
1050 IF (
ASSOCIATED(tmp_basis_set))
THEN
1052 maxnset = max(maxnset, n)
1056 IF (
PRESENT(maxsgf))
THEN
1057 IF (
ASSOCIATED(tmp_basis_set))
THEN
1059 maxsgf = max(maxsgf,
imax)
1063 IF (
PRESENT(maxsgf_set))
THEN
1064 IF (
ASSOCIATED(tmp_basis_set))
THEN
1066 maxsgf_set = max(maxsgf_set,
imax)
1070 IF (
PRESENT(ncgf))
THEN
1071 IF (
ASSOCIATED(tmp_basis_set))
THEN
1073 ncgf = ncgf + n*qs_kind_set(ikind)%natom
1074 ELSE IF (
ASSOCIATED(qs_kind%dftb_parameter))
THEN
1077 ncgf = ncgf + n*qs_kind_set(ikind)%natom
1081 IF (
PRESENT(npgf))
THEN
1082 IF (
ASSOCIATED(tmp_basis_set))
THEN
1084 npgf = npgf + n*qs_kind_set(ikind)%natom
1088 IF (
PRESENT(nset))
THEN
1089 IF (
ASSOCIATED(tmp_basis_set))
THEN
1091 nset = nset + n*qs_kind_set(ikind)%natom
1095 IF (
PRESENT(nsgf))
THEN
1096 IF (
ASSOCIATED(tmp_basis_set))
THEN
1098 nsgf = nsgf + n*qs_kind_set(ikind)%natom
1099 ELSE IF (
ASSOCIATED(qs_kind%dftb_parameter))
THEN
1101 nsgf = nsgf + n*qs_kind_set(ikind)%natom
1105 IF (
PRESENT(nshell))
THEN
1106 IF (
ASSOCIATED(tmp_basis_set))
THEN
1108 nshell = nshell + n*qs_kind_set(ikind)%natom
1109 ELSE IF (
ASSOCIATED(qs_kind%dftb_parameter))
THEN
1111 nshell = nshell + (n + 1)*qs_kind_set(ikind)%natom
1115 IF (
PRESENT(nelectron))
THEN
1116 IF (
ASSOCIATED(qs_kind%all_potential))
THEN
1117 CALL get_potential(potential=qs_kind%all_potential, &
1118 zeff=zeff, zeff_correction=zeff_correction)
1119 ELSE IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
1120 CALL get_potential(potential=qs_kind%gth_potential, &
1121 zeff=zeff, zeff_correction=zeff_correction)
1122 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
1123 CALL get_potential(potential=qs_kind%sgp_potential, &
1124 zeff=zeff, zeff_correction=zeff_correction)
1127 zeff_correction = 0.0_dp
1129 nelectron = nelectron + qs_kind_set(ikind)%natom*nint(zeff - zeff_correction)
1132 IF (
PRESENT(basis_rcut))
THEN
1133 IF (
ASSOCIATED(tmp_basis_set))
THEN
1135 basis_rcut = max(basis_rcut, brcut)
1136 ELSE IF (
ASSOCIATED(qs_kind%dftb_parameter))
THEN
1138 basis_rcut = max(basis_rcut, brcut)
1142 IF (
PRESENT(total_zeff_corr))
THEN
1143 IF (
ASSOCIATED(qs_kind%all_potential))
THEN
1144 CALL get_potential(potential=qs_kind%all_potential, &
1145 zeff=zeff, zeff_correction=zeff_correction)
1146 ELSE IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
1147 CALL get_potential(potential=qs_kind%gth_potential, &
1148 zeff=zeff, zeff_correction=zeff_correction)
1149 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
1150 CALL get_potential(potential=qs_kind%sgp_potential, &
1151 zeff=zeff, zeff_correction=zeff_correction)
1154 zeff_correction = 0.0_dp
1156 total_zeff_corr = total_zeff_corr + qs_kind_set(ikind)%natom*zeff_correction
1159 IF (
PRESENT(all_potential_present))
THEN
1160 IF (
ASSOCIATED(all_potential))
THEN
1161 all_potential_present = .true.
1165 IF (
PRESENT(tnadd_potential_present))
THEN
1166 IF (
ASSOCIATED(tnadd_potential))
THEN
1167 tnadd_potential_present = .true.
1171 IF (
PRESENT(gth_potential_present))
THEN
1172 IF (
ASSOCIATED(gth_potential))
THEN
1173 gth_potential_present = .true.
1177 IF (
PRESENT(sgp_potential_present))
THEN
1178 IF (
ASSOCIATED(sgp_potential))
THEN
1179 sgp_potential_present = .true.
1183 IF (
PRESENT(paw_atom_present))
THEN
1185 paw_atom_present = .true.
1189 IF (
PRESENT(dft_plus_u_atom_present))
THEN
1190 IF (dft_plus_u_atom)
THEN
1191 dft_plus_u_atom_present = .true.
1195 IF (
PRESENT(max_ngrid_rad))
THEN
1196 max_ngrid_rad = max(max_ngrid_rad, ngrid_rad)
1199 IF (
PRESENT(max_sph_harm))
THEN
1200 max_sph_harm = max(max_sph_harm, max_s_harm)
1203 IF (
PRESENT(maxg_iso_not0))
THEN
1204 maxg_iso_not0 = max(maxg_iso_not0, max_iso_not0)
1207 IF (
PRESENT(lmax_rho0))
THEN
1208 lmax_rho0 = max(lmax_rho0, lmax_rho0_kind)
1213 cpabort(
"The pointer qs_kind_set is not associated")
1224 SUBROUTINE init_qs_kind(qs_kind)
1225 TYPE(qs_kind_type),
POINTER :: qs_kind
1227 CHARACTER(len=*),
PARAMETER :: routinen =
'init_qs_kind'
1229 CHARACTER(LEN=default_string_length) :: basis_type
1230 INTEGER :: handle, i
1231 TYPE(gto_basis_set_type),
POINTER :: tmp_basis_set
1233 CALL timeset(routinen, handle)
1235 cpassert(
ASSOCIATED(qs_kind))
1237 IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
1238 CALL init_potential(qs_kind%gth_potential)
1239 ELSEIF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
1240 CALL init_potential(qs_kind%sgp_potential)
1243 DO i = 1,
SIZE(qs_kind%basis_sets, 1)
1244 NULLIFY (tmp_basis_set)
1246 inumbas=i, basis_type=basis_type)
1247 IF (basis_type ==
"") cycle
1248 IF (basis_type ==
"AUX")
THEN
1249 IF (tmp_basis_set%norm_type < 0) tmp_basis_set%norm_type = 1
1252 IF (tmp_basis_set%norm_type < 0) tmp_basis_set%norm_type = 2
1257 CALL timestop(handle)
1259 END SUBROUTINE init_qs_kind
1269 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1271 CHARACTER(len=*),
PARAMETER :: routinen =
'init_qs_kind_set'
1273 INTEGER :: handle, ikind
1274 TYPE(qs_kind_type),
POINTER :: qs_kind
1276 CALL timeset(routinen, handle)
1278 IF (.NOT.
ASSOCIATED(qs_kind_set))
THEN
1279 cpabort(
"init_qs_kind_set: The pointer qs_kind_set is not associated")
1282 DO ikind = 1,
SIZE(qs_kind_set)
1283 qs_kind => qs_kind_set(ikind)
1284 CALL init_qs_kind(qs_kind)
1287 CALL timestop(handle)
1300 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1301 TYPE(qs_control_type),
POINTER :: qs_control
1302 TYPE(section_vals_type),
POINTER :: force_env_section
1303 LOGICAL,
OPTIONAL :: modify_qs_control
1305 CHARACTER(LEN=default_string_length) :: bsname
1306 INTEGER :: bas1c, ikind, ilevel, nkind
1307 LOGICAL :: gpw, my_mod_control, paw_atom
1308 REAL(
dp) :: max_rad_local_type, rc
1309 TYPE(gto_basis_set_type),
POINTER :: basis_1c, orb_basis, soft_basis
1310 TYPE(paw_proj_set_type),
POINTER :: paw_proj
1311 TYPE(qs_kind_type),
POINTER :: qs_kind
1313 my_mod_control = .true.
1314 IF (
PRESENT(modify_qs_control))
THEN
1315 my_mod_control = modify_qs_control
1318 IF (
ASSOCIATED(qs_kind_set))
THEN
1320 IF (my_mod_control) qs_control%gapw_control%non_paw_atoms = .false.
1321 nkind =
SIZE(qs_kind_set)
1325 qs_kind => qs_kind_set(ikind)
1327 CALL get_qs_kind(qs_kind=qs_kind, basis_set=orb_basis)
1328 CALL get_qs_kind(qs_kind=qs_kind, hard_radius=rc, &
1329 max_rad_local=max_rad_local_type, gpw_r3d_rs_type_forced=gpw)
1331 NULLIFY (soft_basis)
1334 qs_control%gapw_control%eps_fit, rc, paw_atom, &
1335 qs_control%gapw_control%force_paw, gpw)
1337 CALL set_qs_kind(qs_kind=qs_kind, paw_atom=paw_atom)
1339 bas1c = qs_control%gapw_control%basis_1c
1353 cpabort(
"basis_1c type")
1358 basis_1c%name = trim(bsname)//
"_1c"
1362 CALL get_qs_kind(qs_kind=qs_kind, paw_proj_set=paw_proj)
1363 CALL projectors(paw_proj, basis_1c, orb_basis, rc, qs_control, &
1364 max_rad_local_type, force_env_section)
1366 IF (my_mod_control) qs_control%gapw_control%non_paw_atoms = .true.
1370 NULLIFY (qs_kind%grid_atom, qs_kind%harmonics)
1376 IF (my_mod_control)
THEN
1377 IF (qs_control%gapw_control%non_paw_atoms)
THEN
1378 qs_control%gapw_control%nopaw_as_gpw = .true.
1380 qs_control%gapw_control%nopaw_as_gpw = .false.
1384 cpabort(
"The pointer qs_kind_set is not associated")
1394 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1396 INTEGER :: i, ic, ikind, n_nlcc, nc, nexp_nlcc, &
1398 INTEGER,
DIMENSION(:),
POINTER :: nct_nlcc
1399 LOGICAL :: nlcc, nlcc_type, paw_atom
1400 REAL(
dp) :: alpha, coa, cval
1401 REAL(kind=
dp),
DIMENSION(:),
POINTER :: a_nlcc, alpha_nlcc, c_nlcc, fe, rc, rr
1402 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: cval_nlcc, den
1403 TYPE(gth_potential_type),
POINTER :: gth_potential
1404 TYPE(qs_kind_type),
POINTER :: qs_kind
1405 TYPE(sgp_potential_type),
POINTER :: sgp_potential
1407 IF (
ASSOCIATED(qs_kind_set))
THEN
1410 nkind =
SIZE(qs_kind_set)
1412 qs_kind => qs_kind_set(ikind)
1415 CALL get_qs_kind(qs_kind, gth_potential=gth_potential)
1416 CALL get_qs_kind(qs_kind, sgp_potential=sgp_potential)
1417 IF (
ASSOCIATED(gth_potential))
THEN
1418 CALL get_potential(potential=gth_potential, nlcc_present=nlcc_type, &
1419 nexp_nlcc=nexp_nlcc, alpha_nlcc=alpha_nlcc, nct_nlcc=nct_nlcc, cval_nlcc=cval_nlcc)
1421 nr = qs_kind%grid_atom%nr
1422 rr => qs_kind%grid_atom%rad
1423 ALLOCATE (qs_kind%nlcc_pot(nr, 2), rc(nr), fe(nr))
1424 den => qs_kind%nlcc_pot
1427 alpha = alpha_nlcc(i)
1429 fe(:) = exp(-0.5_dp*rc(:)*rc(:))
1432 cval = cval_nlcc(ic, i)
1434 den(:, 1) = den(:, 1) + fe(:)*rc**(2*ic - 2)*cval
1435 den(:, 2) = den(:, 2) - fe(:)*rc**(2*ic - 1)*coa
1437 den(:, 2) = den(:, 2) + real(2*ic - 2,
dp)*fe(:)*rc**(2*ic - 3)*coa
1443 ELSE IF (
ASSOCIATED(sgp_potential))
THEN
1444 CALL get_potential(potential=sgp_potential,
has_nlcc=nlcc_type, &
1445 n_nlcc=n_nlcc, a_nlcc=a_nlcc, c_nlcc=c_nlcc)
1447 nr = qs_kind%grid_atom%nr
1448 rr => qs_kind%grid_atom%rad
1449 ALLOCATE (qs_kind%nlcc_pot(nr, 2), rc(nr), fe(nr))
1450 den => qs_kind%nlcc_pot
1454 fe(:) = exp(-alpha*rr(:)*rr(:))
1456 den(:, 1) = den(:, 1) + cval*fe(:)
1457 den(:, 2) = den(:, 2) - 2.0_dp*alpha*cval*rr(:)*fe(:)
1468 cpabort(
"The pointer qs_kind_set is not associated")
1486 SUBROUTINE read_qs_kind(qs_kind, kind_section, para_env, force_env_section, no_fail, method_id)
1488 TYPE(qs_kind_type),
INTENT(INOUT) :: qs_kind
1489 TYPE(section_vals_type),
POINTER :: kind_section
1490 TYPE(mp_para_env_type),
POINTER :: para_env
1491 TYPE(section_vals_type),
POINTER :: force_env_section
1492 LOGICAL,
INTENT(IN) :: no_fail
1493 INTEGER,
INTENT(IN) :: method_id
1495 CHARACTER(LEN=*),
PARAMETER :: routinen =
'read_qs_kind'
1496 INTEGER,
PARAMETER :: maxbas = 20
1498 CHARACTER(LEN=2) :: element_symbol
1499 CHARACTER(len=default_path_length) :: kg_potential_fn_kind, &
1500 potential_file_name, potential_fn_kind
1501 CHARACTER(LEN=default_string_length) :: akind_name, basis_type, keyword, &
1502 kgpot_name, kgpot_type, &
1503 potential_name, potential_type, tmp
1504 CHARACTER(LEN=default_string_length),
DIMENSION(4) :: description
1505 CHARACTER(LEN=default_string_length), &
1506 DIMENSION(:),
POINTER :: tmpstringlist
1507 CHARACTER(LEN=default_string_length), &
1508 DIMENSION(maxbas) :: basis_set_form, basis_set_name, &
1510 INTEGER :: handle, i, i_rep, iounit, ipaodesc, ipaopot, ipos, j, jj, k_rep, l, m, n_rep, &
1511 nb_rep, nexp, ngauss, nlcc, nloc, nnl, norbitals, npaodesc, npaopot, nppnl, nspin, nu, z
1512 INTEGER,
DIMENSION(:),
POINTER :: add_el, elec_conf, orbitals
1513 LOGICAL :: check, ecp_semi_local, explicit, explicit_basis, explicit_j, explicit_kgpot, &
1514 explicit_potential, explicit_u, explicit_u_m_j, nobasis, section_enabled, &
1515 subsection_enabled, update_input
1516 REAL(kind=
dp) :: alpha, ccore, r, rc, zeff_correction
1517 REAL(kind=
dp),
DIMENSION(6) :: error
1518 REAL(kind=
dp),
DIMENSION(:),
POINTER :: a_nl, aloc, anlcc, cloc, cnlcc, nelec
1519 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: h_nl
1520 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: c_nl
1521 TYPE(atom_ecppot_type) :: ecppot
1524 TYPE(cp_logger_type),
POINTER :: logger
1525 TYPE(gto_basis_set_type),
POINTER :: orb_basis_set, sup_basis_set, &
1527 TYPE(section_vals_type),
POINTER :: basis_section, bs_section, dft_plus_u_section, &
1528 dft_section, enforce_occupation_section, kgpot_section, pao_desc_section, &
1529 pao_pot_section, potential_section, spin_section
1530 TYPE(sto_basis_set_type),
POINTER :: sto_basis_set
1532 CALL timeset(routinen, handle)
1540 update_input = .true.
1541 basis_set_name(:) =
""
1542 basis_set_type(:) =
""
1543 basis_set_form(:) =
""
1549 zeff_correction = 0.0_dp
1551 explicit_basis = .false.
1552 explicit_j = .false.
1553 explicit_kgpot = .false.
1554 explicit_potential = .false.
1555 explicit_u = .false.
1556 explicit_u_m_j = .false.
1561 akind_name = qs_kind%name
1566 c_val=keyword, i_rep_section=i_rep)
1568 IF (keyword == akind_name)
THEN
1575 ipos = index(qs_kind%name,
"_")
1576 IF (((ipos == 2) .OR. (ipos == 3)) .AND. (index(qs_kind%name,
"_ghost") == 0))
THEN
1579 akind_name = qs_kind%name(1:ipos - 1)
1583 c_val=keyword, i_rep_section=i_rep)
1585 IF (keyword == akind_name)
THEN
1596 element_symbol = qs_kind%element_symbol(1:2)
1600 c_val=keyword, i_rep_section=i_rep)
1602 IF (keyword == element_symbol)
THEN
1613 c_val=keyword, i_rep_section=i_rep)
1615 IF (keyword ==
"DEFAULT")
THEN
1616 update_input = .false.
1622 IF (k_rep < 0 .AND. (.NOT. no_fail))
THEN
1623 CALL cp_abort(__location__, &
1624 "No &KIND section was possible to associate to the atomic kind <"// &
1625 trim(akind_name)//
">. The KIND section were also scanned for the"// &
1626 " corresponding element <"//trim(qs_kind%element_symbol)//
">"// &
1627 " and for the DEFAULT section but no match was found. Check your input file!")
1636 keyword_name=
"BASIS_SET", &
1637 explicit=explicit, &
1639 IF (.NOT. explicit) nb_rep = 0
1640 cpassert(nb_rep <= maxbas)
1643 keyword_name=
"BASIS_SET", i_rep_val=i, c_vals=tmpstringlist)
1644 IF (
SIZE(tmpstringlist) == 1)
THEN
1646 basis_set_type(i) =
"ORB"
1647 basis_set_form(i) =
"GTO"
1648 basis_set_name(i) = tmpstringlist(1)
1649 ELSEIF (
SIZE(tmpstringlist) == 2)
THEN
1651 basis_set_type(i) = tmpstringlist(1)
1652 basis_set_form(i) =
"GTO"
1653 basis_set_name(i) = tmpstringlist(2)
1654 ELSEIF (
SIZE(tmpstringlist) == 3)
THEN
1655 basis_set_type(i) = tmpstringlist(1)
1656 basis_set_form(i) = tmpstringlist(2)
1657 basis_set_name(i) = tmpstringlist(3)
1659 CALL cp_abort(__location__, &
1660 "invalid number of BASIS_SET keyword parameters: BASIS_SET [<TYPE>] [<FORM>] <NAME>")
1663 IF (basis_set_form(i) /=
"GTO" .AND. basis_set_form(i) /=
"STO")
THEN
1664 cpabort(
"invalid BASIS_SET FORM parameter")
1670 i_val=qs_kind%pao_basis_size)
1675 ALLOCATE (qs_kind%pao_potentials(npaopot))
1676 DO ipaopot = 1, npaopot
1678 i_val=qs_kind%pao_potentials(ipaopot)%maxl)
1679 CALL section_vals_val_get(pao_pot_section, keyword_name=
"MAX_PROJECTOR", i_rep_section=ipaopot, &
1680 i_val=qs_kind%pao_potentials(ipaopot)%max_projector)
1682 r_val=qs_kind%pao_potentials(ipaopot)%beta)
1684 r_val=qs_kind%pao_potentials(ipaopot)%weight)
1690 ALLOCATE (qs_kind%pao_descriptors(npaodesc))
1691 DO ipaodesc = 1, npaodesc
1693 r_val=qs_kind%pao_descriptors(ipaodesc)%beta)
1694 CALL section_vals_val_get(pao_desc_section, keyword_name=
"SCREENING", i_rep_section=ipaodesc, &
1695 r_val=qs_kind%pao_descriptors(ipaodesc)%screening)
1697 r_val=qs_kind%pao_descriptors(ipaodesc)%weight)
1702 keyword_name=
"ELEC_CONF", n_rep_val=i)
1705 keyword_name=
"ELEC_CONF", i_vals=elec_conf)
1709 keyword_name=
"CORE_CORRECTION", r_val=zeff_correction)
1712 keyword_name=
"POTENTIAL_FILE_NAME", c_val=potential_fn_kind)
1714 keyword_name=
"POTENTIAL_TYPE", c_val=potential_type)
1716 explicit=explicit, keyword_name=
"POTENTIAL", c_vals=tmpstringlist)
1718 IF (
SIZE(tmpstringlist) == 1)
THEN
1720 potential_name = tmpstringlist(1)
1721 IF (potential_type ==
"")
THEN
1722 ipos = index(potential_name,
"-")
1724 potential_type = potential_name(:ipos - 1)
1726 potential_type = potential_name
1729 ELSEIF (
SIZE(tmpstringlist) == 2)
THEN
1730 potential_type = tmpstringlist(1)
1731 potential_name = tmpstringlist(2)
1733 cpabort(
"POTENTIAL input list is not correct")
1740 keyword_name=
"KG_POTENTIAL_FILE_NAME", c_val=kg_potential_fn_kind)
1742 keyword_name=
"KG_POTENTIAL", c_val=kgpot_name)
1746 keyword_name=
"ECP_SEMI_LOCAL", l_val=ecp_semi_local)
1749 qs_kind%covalent_radius =
ptable(z)%covalent_radius*
bohr
1751 keyword_name=
"COVALENT_RADIUS", r_val=r)
1752 IF (r > 0.0_dp) qs_kind%covalent_radius = r
1755 qs_kind%vdw_radius =
ptable(z)%vdw_radius*
bohr
1757 keyword_name=
"VDW_RADIUS", r_val=r)
1758 IF (r > 0.0_dp) qs_kind%vdw_radius = r
1762 keyword_name=
"HARD_EXP_RADIUS")
1765 qs_kind%hard_radius = 1.2_dp
1767 qs_kind%hard_radius = 0.8_dp*
bohr
1771 keyword_name=
"HARD_EXP_RADIUS", r_val=qs_kind%hard_radius)
1776 keyword_name=
"RHO0_EXP_RADIUS")
1778 qs_kind%hard0_radius = qs_kind%hard_radius
1781 keyword_name=
"RHO0_EXP_RADIUS", r_val=qs_kind%hard0_radius)
1783 IF (qs_kind%hard_radius < qs_kind%hard0_radius) &
1784 cpabort(
"rc0 should be <= rc")
1787 keyword_name=
"MAX_RAD_LOCAL", r_val=qs_kind%max_rad_local)
1789 keyword_name=
"LEBEDEV_GRID", i_val=qs_kind%ngrid_ang)
1790 IF (qs_kind%ngrid_ang <= 0) &
1791 cpabort(
"# point lebedev grid < 0")
1793 keyword_name=
"RADIAL_GRID", i_val=qs_kind%ngrid_rad)
1794 IF (qs_kind%ngrid_rad <= 0) &
1795 cpabort(
"# point radial grid < 0")
1797 keyword_name=
"GPW_TYPE", l_val=qs_kind%gpw_r3d_rs_type_forced)
1799 keyword_name=
"GHOST", l_val=qs_kind%ghost)
1801 keyword_name=
"FLOATING_BASIS_CENTER", l_val=qs_kind%floating)
1803 keyword_name=
"NO_OPTIMIZE", l_val=qs_kind%no_optimize)
1807 keyword_name=
"MAGNETIZATION", r_val=qs_kind%magnetization)
1810 keyword_name=
"DFTB3_PARAM", r_val=qs_kind%dudq_dftb3)
1812 keyword_name=
"LMAX_DFTB", i_val=qs_kind%lmax_dftb)
1816 keyword_name=
"MAO", i_val=qs_kind%mao)
1819 NULLIFY (bs_section)
1821 i_rep_section=k_rep)
1822 section_enabled = .false.
1824 l_val=section_enabled)
1825 IF (section_enabled)
THEN
1827 IF (qs_kind%magnetization /= 0.0_dp)
THEN
1828 CALL cp_abort(__location__,
"BS Section is in conflict with non-zero magnetization "// &
1829 "for this atom kind.")
1831 qs_kind%bs_occupation = .true.
1833 NULLIFY (spin_section)
1839 keyword_name=
"NEL", i_vals=add_el)
1840 cpassert(
ASSOCIATED(add_el))
1841 ALLOCATE (qs_kind%addel(
SIZE(add_el), 2))
1843 qs_kind%addel(1:
SIZE(add_el), 1) = add_el(1:
SIZE(add_el))
1846 keyword_name=
"L", i_vals=add_el)
1847 cpassert(
ASSOCIATED(add_el))
1848 cpassert(
SIZE(add_el) ==
SIZE(qs_kind%addel, 1))
1849 ALLOCATE (qs_kind%laddel(
SIZE(add_el), 2))
1851 qs_kind%laddel(1:
SIZE(add_el), 1) = add_el(1:
SIZE(add_el))
1852 ALLOCATE (qs_kind%naddel(
SIZE(add_el), 2))
1856 keyword_name=
"N", n_rep_val=i)
1859 keyword_name=
"N", i_vals=add_el)
1860 IF (
SIZE(add_el) ==
SIZE(qs_kind%addel, 1))
THEN
1861 qs_kind%naddel(1:
SIZE(add_el), 1) = add_el(1:
SIZE(add_el))
1866 NULLIFY (spin_section)
1872 keyword_name=
"NEL", i_vals=add_el)
1873 cpassert(
SIZE(add_el) ==
SIZE(qs_kind%addel, 1))
1874 qs_kind%addel(1:
SIZE(add_el), 2) = add_el(1:
SIZE(add_el))
1875 qs_kind%addel(:, :) = qs_kind%addel(:, :)
1878 keyword_name=
"L", i_vals=add_el)
1879 cpassert(
SIZE(add_el) ==
SIZE(qs_kind%addel, 1))
1880 qs_kind%laddel(1:
SIZE(add_el), 2) = add_el(1:
SIZE(add_el))
1883 keyword_name=
"N", n_rep_val=i)
1887 keyword_name=
"N", i_vals=add_el)
1888 IF (
SIZE(add_el) ==
SIZE(qs_kind%addel, 1))
THEN
1889 qs_kind%naddel(1:
SIZE(add_el), 2) = add_el(1:
SIZE(add_el))
1897 NULLIFY (dft_plus_u_section)
1899 subsection_name=
"DFT_PLUS_U", &
1900 i_rep_section=k_rep)
1901 section_enabled = .false.
1903 keyword_name=
"_SECTION_PARAMETERS_", &
1904 l_val=section_enabled)
1905 IF (section_enabled)
THEN
1906 ALLOCATE (qs_kind%dft_plus_u)
1907 NULLIFY (qs_kind%dft_plus_u%nelec)
1908 NULLIFY (qs_kind%dft_plus_u%orbitals)
1912 qs_kind%dft_plus_u%l = l
1913 #if defined(__SIRIUS)
1917 qs_kind%dft_plus_u%n = nu
1921 r_val=qs_kind%dft_plus_u%U, &
1922 explicit=explicit_u)
1926 r_val=qs_kind%dft_plus_u%J, &
1927 explicit=explicit_j)
1930 keyword_name=
"alpha", &
1931 r_val=qs_kind%dft_plus_u%alpha)
1934 keyword_name=
"beta", &
1935 r_val=qs_kind%dft_plus_u%beta)
1938 keyword_name=
"J0", &
1939 r_val=qs_kind%dft_plus_u%J0)
1942 keyword_name=
"occupation", &
1943 r_val=qs_kind%dft_plus_u%occupation)
1949 keyword_name=
"U_MINUS_J", &
1950 r_val=qs_kind%dft_plus_u%u_minus_j_target, &
1951 explicit=explicit_u_m_j)
1953 IF ((explicit_u .OR. explicit_j) .AND. explicit_u_m_j)
THEN
1954 cpabort(
"DFT+U| specifying U or J and U_MINUS_J parameters are mutually exclusive.")
1958 keyword_name=
"U_RAMPING", &
1959 r_val=qs_kind%dft_plus_u%u_ramping)
1961 keyword_name=
"INIT_U_RAMPING_EACH_SCF", &
1962 l_val=qs_kind%dft_plus_u%init_u_ramping_each_scf)
1963 IF (qs_kind%dft_plus_u%u_ramping > 0.0_dp)
THEN
1964 qs_kind%dft_plus_u%u_minus_j = 0.0_dp
1966 qs_kind%dft_plus_u%u_minus_j = qs_kind%dft_plus_u%u_minus_j_target
1969 keyword_name=
"EPS_U_RAMPING", &
1970 r_val=qs_kind%dft_plus_u%eps_u_ramping)
1972 NULLIFY (enforce_occupation_section)
1974 subsection_name=
"ENFORCE_OCCUPATION")
1975 subsection_enabled = .false.
1977 keyword_name=
"_SECTION_PARAMETERS_", &
1978 l_val=subsection_enabled)
1979 IF (subsection_enabled)
THEN
1982 keyword_name=
"NELEC", &
1985 ALLOCATE (qs_kind%dft_plus_u%nelec(nspin))
1986 qs_kind%dft_plus_u%nelec(:) = nelec(:)
1989 keyword_name=
"ORBITALS", &
1991 norbitals =
SIZE(orbitals)
1992 IF (norbitals <= 0 .OR. norbitals > 2*l + 1) &
1993 CALL cp_abort(__location__,
"DFT+U| Invalid number of ORBITALS specified: "// &
1994 "1 to 2*L+1 integer numbers are expected")
1995 ALLOCATE (qs_kind%dft_plus_u%orbitals(norbitals))
1996 qs_kind%dft_plus_u%orbitals(:) = orbitals(:)
1999 IF (qs_kind%dft_plus_u%orbitals(m) > l) &
2000 cpabort(
"DFT+U| Invalid orbital magnetic quantum number specified: m > l")
2001 IF (qs_kind%dft_plus_u%orbitals(m) < -l) &
2002 cpabort(
"DFT+U| Invalid orbital magnetic quantum number specified: m < -l")
2005 IF (qs_kind%dft_plus_u%orbitals(j) == qs_kind%dft_plus_u%orbitals(m)) &
2006 cpabort(
"DFT+U| An orbital magnetic quantum number was specified twice")
2011 keyword_name=
"EPS_SCF", &
2012 r_val=qs_kind%dft_plus_u%eps_scf)
2014 keyword_name=
"MAX_SCF", &
2016 qs_kind%dft_plus_u%max_scf = max(-1, i)
2018 keyword_name=
"SMEAR", &
2019 l_val=qs_kind%dft_plus_u%smear)
2030 explicit_basis = .false.
2033 can_return_null=.true.)
2037 explicit_potential = .false.
2040 i_rep_section=k_rep, can_return_null=.true.)
2044 explicit_kgpot = .false.
2047 i_rep_section=k_rep, can_return_null=.true.)
2051 SELECT CASE (method_id)
2055 CALL allocate_potential(qs_kind%all_potential)
2058 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2059 CALL get_potential(potential=qs_kind%all_potential, elec_conf=elec_conf)
2062 cpassert(.NOT. qs_kind%floating)
2063 IF (qs_kind%ghost)
THEN
2064 CALL get_qs_kind(qs_kind=qs_kind, elec_conf=elec_conf)
2066 CALL get_potential(potential=qs_kind%all_potential, &
2067 elec_conf=elec_conf)
2069 CALL set_potential(potential=qs_kind%all_potential, &
2071 zeff_correction=0.0_dp)
2076 check = .NOT.
ASSOCIATED(qs_kind%se_parameter)
2084 keyword_name=
"SE_P_ORBITALS_ON_H", l_val=qs_kind%se_parameter%p_orbitals_on_h)
2092 NULLIFY (tmp_basis_set)
2093 CALL init_se_param(qs_kind%se_parameter, tmp_basis_set, ngauss)
2095 CALL init_potential(qs_kind%all_potential, itype=
"BARE", &
2096 zeff=qs_kind%se_parameter%zeff, zeff_correction=zeff_correction)
2097 qs_kind%se_parameter%zeff = qs_kind%se_parameter%zeff - zeff_correction
2099 check = ((potential_name /=
'') .OR. explicit_potential)
2101 CALL cp_warn(__location__, &
2102 "Information provided in the input file regarding POTENTIAL for KIND <"// &
2103 trim(qs_kind%name)//
"> will be ignored!")
2105 check = ((k_rep > 0) .OR. explicit_basis)
2107 CALL cp_warn(__location__, &
2108 "Information provided in the input file regarding BASIS for KIND <"// &
2109 trim(qs_kind%name)//
"> will be ignored!")
2113 CALL allocate_potential(qs_kind%all_potential)
2116 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2117 CALL get_potential(potential=qs_kind%all_potential, elec_conf=elec_conf)
2120 cpassert(.NOT. qs_kind%floating)
2121 IF (qs_kind%ghost)
THEN
2122 CALL get_qs_kind(qs_kind=qs_kind, elec_conf=elec_conf)
2124 CALL get_potential(potential=qs_kind%all_potential, &
2125 elec_conf=elec_conf)
2127 CALL set_potential(potential=qs_kind%all_potential, &
2129 zeff_correction=0.0_dp)
2132 check = ((potential_name /=
'') .OR. explicit_potential)
2134 CALL cp_warn(__location__, &
2135 "Information provided in the input file regarding POTENTIAL for KIND <"// &
2136 trim(qs_kind%name)//
"> will be ignored!")
2138 check = ((k_rep > 0) .OR. explicit_basis)
2140 CALL cp_warn(__location__, &
2141 "Information provided in the input file regarding BASIS for KIND <"// &
2142 trim(qs_kind%name)//
"> will be ignored!")
2146 CALL allocate_potential(qs_kind%all_potential)
2149 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2150 CALL get_potential(potential=qs_kind%all_potential, elec_conf=elec_conf)
2153 cpassert(.NOT. qs_kind%floating)
2154 IF (qs_kind%ghost)
THEN
2155 CALL get_qs_kind(qs_kind=qs_kind, elec_conf=elec_conf)
2157 CALL get_potential(potential=qs_kind%all_potential, &
2158 elec_conf=elec_conf)
2160 CALL set_potential(potential=qs_kind%all_potential, &
2162 zeff_correction=0.0_dp)
2165 check = ((potential_name /=
'') .OR. explicit_potential)
2167 CALL cp_warn(__location__, &
2168 "Information provided in the input file regarding POTENTIAL for KIND <"// &
2169 trim(qs_kind%name)//
"> will be ignored!")
2171 check = ((k_rep > 0) .OR. explicit_basis)
2173 CALL cp_warn(__location__, &
2174 "Information provided in the input file regarding BASIS for KIND <"// &
2175 trim(qs_kind%name)//
"> will be ignored!")
2180 IF (potential_name /=
'')
THEN
2181 SELECT CASE (trim(potential_type))
2183 CALL cp_abort(__location__, &
2184 "PW DFT calculations only with potential type UPF or GTH possible."// &
2185 " <"//trim(potential_type)//
"> was specified "// &
2186 "for the atomic kind <"//trim(qs_kind%name))
2188 IF (potential_fn_kind ==
"-")
THEN
2191 potential_file_name = potential_fn_kind
2193 CALL allocate_potential(qs_kind%gth_potential)
2194 CALL read_potential(qs_kind%element_symbol, potential_name, &
2195 qs_kind%gth_potential, zeff_correction, para_env, &
2196 potential_file_name, potential_section, update_input)
2197 CALL set_potential(qs_kind%gth_potential, z=z)
2199 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2200 CALL get_potential(potential=qs_kind%gth_potential, elec_conf=elec_conf)
2203 CALL set_potential(potential=qs_kind%gth_potential, elec_conf=elec_conf)
2206 ALLOCATE (qs_kind%upf_potential)
2207 CALL atom_read_upf(qs_kind%upf_potential, potential_name, read_header=.true.)
2209 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2210 CALL set_qs_kind(qs_kind, elec_conf=qs_kind%upf_potential%econf)
2213 CALL cp_abort(__location__, &
2214 "An invalid potential type <"// &
2215 trim(potential_type)//
"> was specified "// &
2216 "for the atomic kind <"// &
2220 CALL cp_abort(__location__, &
2221 "No potential type was defined for the "// &
2222 "atomic kind <"//trim(qs_kind%name)//
">")
2232 SELECT CASE (basis_set_form(i))
2234 NULLIFY (tmp_basis_set)
2236 CALL read_gto_basis_set(qs_kind%element_symbol, basis_set_name(i), &
2237 tmp_basis_set, para_env, dft_section)
2239 NULLIFY (sto_basis_set)
2242 sto_basis_set, para_env, dft_section)
2243 NULLIFY (tmp_basis_set)
2247 CALL cp_abort(__location__, &
2248 "Invalid basis set form "//trim(basis_set_form(i))// &
2249 "for atomic kind <"//trim(qs_kind%name)//
">")
2251 tmp = basis_set_type(i)
2256 IF (explicit_basis)
THEN
2259 NULLIFY (tmp_basis_set)
2261 CALL read_gto_basis_set(qs_kind%element_symbol, basis_type, &
2262 tmp_basis_set, basis_section, i, dft_section)
2269 DO i = 1,
SIZE(qs_kind%basis_sets)
2270 NULLIFY (tmp_basis_set)
2272 inumbas=i, basis_type=basis_type)
2273 IF (basis_type ==
"") cycle
2275 DO j = i + 1,
SIZE(qs_kind%basis_sets)
2277 NULLIFY (sup_basis_set)
2279 inumbas=jj, basis_type=tmp)
2280 IF (basis_type == tmp)
THEN
2287 NULLIFY (sup_basis_set)
2292 DO i = 1,
SIZE(qs_kind%basis_sets)
2293 NULLIFY (tmp_basis_set)
2295 inumbas=i, basis_type=basis_type)
2296 IF (basis_type ==
"ORB") nobasis = .false.
2299 CALL cp_abort(__location__, &
2300 "No basis set type was defined for the "// &
2301 "atomic kind <"//trim(qs_kind%name)//
">")
2305 IF (qs_kind%ghost .OR. qs_kind%floating)
THEN
2306 IF (
ASSOCIATED(qs_kind%elec_conf)) qs_kind%elec_conf = 0
2309 IF ((potential_name /=
'') .OR. explicit_potential)
THEN
2311 IF (potential_fn_kind ==
"-")
THEN
2314 potential_file_name = potential_fn_kind
2317 SELECT CASE (trim(potential_type))
2319 CALL allocate_potential(qs_kind%all_potential)
2320 CALL read_potential(qs_kind%element_symbol, potential_name, &
2321 qs_kind%all_potential, zeff_correction, para_env, &
2322 potential_file_name, potential_section, update_input)
2323 CALL set_potential(qs_kind%all_potential, z=z)
2325 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2326 CALL get_potential(potential=qs_kind%all_potential, elec_conf=elec_conf)
2329 CALL set_potential(potential=qs_kind%all_potential, elec_conf=elec_conf)
2332 CALL allocate_potential(qs_kind%gth_potential)
2333 CALL read_potential(qs_kind%element_symbol, potential_name, &
2334 qs_kind%gth_potential, zeff_correction, para_env, &
2335 potential_file_name, potential_section, update_input)
2336 CALL set_potential(qs_kind%gth_potential, z=z)
2338 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2339 CALL get_potential(potential=qs_kind%gth_potential, elec_conf=elec_conf)
2342 CALL set_potential(potential=qs_kind%gth_potential, elec_conf=elec_conf)
2345 CALL allocate_potential(qs_kind%sgp_potential)
2346 CALL get_potential(qs_kind%sgp_potential, description=description)
2348 potential_name, potential_file_name, potential_section)
2349 IF (ecp_semi_local)
THEN
2350 description(1) =
"Semi-local Gaussian pseudopotential "
2351 description(2) =
"ECP "//trim(potential_name)
2352 description(3) =
"LIBGRPP: A. V. Oleynichenko et al., Symmetry 15 197 2023"
2353 description(4) =
" "
2355 description(4) =
"ECP "//trim(potential_name)
2357 CALL set_potential(qs_kind%sgp_potential, name=ecppot%pname, description=description, &
2358 zeff=ecppot%zion, z=z, ecp_local=.true., ecp_semi_local=ecp_semi_local, &
2359 nloc=ecppot%nloc, nrloc=ecppot%nrloc, aloc=ecppot%aloc, bloc=ecppot%bloc, &
2361 CALL set_potential(qs_kind%sgp_potential, sl_lmax=ecppot%lmax, &
2362 npot=ecppot%npot, nrpot=ecppot%nrpot, apot=ecppot%apot, bpot=ecppot%bpot)
2364 IF (.NOT. ecp_semi_local)
THEN
2365 cpabort(
"ECPs are only well tested in their semi-local form")
2366 CALL get_qs_kind(qs_kind, basis_set=orb_basis_set)
2367 CALL sgp_construction(sgp_pot=sgppot, ecp_pot=ecppot, orb_basis=orb_basis_set, error=error)
2368 IF (iounit > 0)
THEN
2369 WRITE (iounit,
"(/,T2,'PP Transformation for ',A)") trim(ecppot%pname)
2370 IF (sgppot%has_local)
THEN
2371 WRITE (iounit,
"(T8,'Accuracy for local part:',T41,F10.3,'%',T61,F20.12)") error(4), error(1)
2373 IF (sgppot%has_nonlocal)
THEN
2374 WRITE (iounit,
"(T8,'Accuracy for nonlocal part:',T41,F10.3,'%',T61,F20.12)") error(5), error(2)
2376 IF (sgppot%has_nlcc)
THEN
2377 WRITE (iounit,
"(T8,'Accuracy for NLCC density:',T61,F20.12)") error(3)
2381 IF (sgppot%has_nonlocal)
THEN
2382 CALL set_potential(qs_kind%sgp_potential, n_nonlocal=sgppot%n_nonlocal, lmax=sgppot%lmax, &
2383 is_nonlocal=sgppot%is_nonlocal)
2384 nnl = sgppot%n_nonlocal
2386 DO l = 0, sgppot%lmax
2387 nppnl = nppnl + nnl*
nco(l)
2390 ALLOCATE (a_nl(nnl), h_nl(nnl, 0:l), c_nl(nnl, nnl, 0:l))
2391 a_nl(:) = sgppot%a_nonlocal(:)
2392 h_nl(:, :) = sgppot%h_nonlocal(:, :)
2393 DO l = 0, sgppot%lmax
2394 c_nl(:, :, l) = sgppot%c_nonlocal(:, :, l)*sqrt(2._dp*l + 1.0_dp)
2396 CALL set_potential(qs_kind%sgp_potential, nppnl=nppnl, a_nonlocal=a_nl, h_nonlocal=h_nl, c_nonlocal=c_nl)
2398 CALL set_potential(qs_kind%sgp_potential, n_nonlocal=0, lmax=-1, is_nonlocal=sgppot%is_nonlocal)
2399 CALL set_potential(qs_kind%sgp_potential, nppnl=0)
2402 cpassert(.NOT. sgppot%has_local)
2403 cpassert(.NOT. sgppot%has_nlcc)
2405 rc = 0.5_dp*qs_kind%covalent_radius*
angstrom
2406 rc = max(rc, 0.2_dp)
2407 rc = min(rc, 1.0_dp)
2408 alpha = 1.0_dp/(2.0_dp*rc**2)
2409 ccore = ecppot%zion*sqrt((alpha/
pi)**3)
2410 CALL set_potential(qs_kind%sgp_potential, alpha_core_charge=alpha, ccore_charge=ccore, &
2411 core_charge_radius=rc)
2414 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2418 CALL set_potential(qs_kind%sgp_potential, elec_conf=elec_conf)
2420 CALL allocate_potential(qs_kind%sgp_potential)
2421 CALL get_potential(qs_kind%sgp_potential, description=description)
2422 description(4) =
"UPF "//trim(potential_name)
2424 CALL set_potential(qs_kind%sgp_potential, name=upfpot%pname, description=description, &
2425 zeff=upfpot%zion, z=z,
has_nlcc=upfpot%core_correction)
2428 IF (iounit > 0)
THEN
2429 WRITE (iounit,
"(/,T2,'PP Transformation for ',A)") trim(upfpot%pname)
2430 IF (sgppot%has_local)
THEN
2431 WRITE (iounit,
"(T8,'Accuracy for local part:',T61,F20.12)") error(1)
2433 IF (sgppot%has_nonlocal)
THEN
2434 WRITE (iounit,
"(T8,'Accuracy for nonlocal part:',T61,F20.12)") error(2)
2436 IF (sgppot%has_nlcc)
THEN
2437 WRITE (iounit,
"(T8,'Accuracy for NLCC density:',T61,F20.12)") error(3)
2440 IF (sgppot%has_nonlocal)
THEN
2441 CALL set_potential(qs_kind%sgp_potential, n_nonlocal=sgppot%n_nonlocal, lmax=sgppot%lmax, &
2442 is_nonlocal=sgppot%is_nonlocal)
2443 nnl = sgppot%n_nonlocal
2445 DO l = 0, sgppot%lmax
2446 nppnl = nppnl + nnl*
nco(l)
2449 ALLOCATE (a_nl(nnl), h_nl(nnl, 0:l), c_nl(nnl, nnl, 0:l))
2450 a_nl(:) = sgppot%a_nonlocal(:)
2451 h_nl(:, :) = sgppot%h_nonlocal(:, :)
2452 c_nl(:, :, :) = sgppot%c_nonlocal(:, :, :)
2453 CALL set_potential(qs_kind%sgp_potential, nppnl=nppnl, a_nonlocal=a_nl, h_nonlocal=h_nl, c_nonlocal=c_nl)
2455 CALL set_potential(qs_kind%sgp_potential, n_nonlocal=0, lmax=-1, is_nonlocal=sgppot%is_nonlocal)
2456 CALL set_potential(qs_kind%sgp_potential, nppnl=0)
2458 cpassert(sgppot%has_local)
2460 rc = sgppot%ac_local
2461 alpha = 1.0_dp/(2.0_dp*rc**2)
2462 ccore = upfpot%zion*sqrt((alpha/
pi)**3)
2463 CALL set_potential(qs_kind%sgp_potential, alpha_core_charge=alpha, ccore_charge=ccore, &
2464 core_charge_radius=rc)
2466 nloc = sgppot%n_local
2467 ALLOCATE (aloc(nloc), cloc(nloc))
2468 aloc(1:nloc) = sgppot%a_local(1:nloc)
2469 cloc(1:nloc) = sgppot%c_local(1:nloc)
2470 CALL set_potential(qs_kind%sgp_potential, n_local=nloc, a_local=aloc, c_local=cloc)
2471 IF (sgppot%has_nlcc)
THEN
2472 nlcc = sgppot%n_nlcc
2473 ALLOCATE (anlcc(nlcc), cnlcc(nlcc))
2474 anlcc(1:nlcc) = sgppot%a_nlcc(1:nlcc)
2475 cnlcc(1:nlcc) = sgppot%c_nlcc(1:nlcc)
2476 CALL set_potential(qs_kind%sgp_potential,
has_nlcc=.true., n_nlcc=nlcc, a_nlcc=anlcc, c_nlcc=cnlcc)
2478 CALL set_potential(qs_kind%sgp_potential, z=z)
2480 IF (.NOT.
ASSOCIATED(elec_conf))
THEN
2484 CALL set_potential(qs_kind%sgp_potential, elec_conf=elec_conf)
2488 CALL cp_abort(__location__, &
2489 "An invalid potential type <"// &
2490 trim(potential_name)//
"> was specified "// &
2491 "for the atomic kind <"// &
2495 CALL cp_abort(__location__, &
2496 "No potential type was defined for the "// &
2497 "atomic kind <"//trim(qs_kind%name)//
">")
2500 CALL check_potential_basis_compatibility(qs_kind)
2503 IF ((kgpot_name /=
'') .OR. explicit_kgpot)
THEN
2504 ipos = index(kgpot_name,
"-")
2506 kgpot_type = kgpot_name(:ipos - 1)
2508 kgpot_type = kgpot_name
2512 SELECT CASE (trim(kgpot_type))
2515 IF (kg_potential_fn_kind ==
"-")
THEN
2518 potential_file_name = kg_potential_fn_kind
2520 CALL allocate_potential(qs_kind%tnadd_potential)
2521 CALL read_potential(qs_kind%element_symbol, kgpot_name, &
2522 qs_kind%tnadd_potential, para_env, &
2523 potential_file_name, kgpot_section, update_input)
2525 NULLIFY (qs_kind%tnadd_potential)
2527 CALL cp_abort(__location__, &
2528 "An invalid kg_potential type <"// &
2529 trim(potential_name)//
"> was specified "// &
2530 "for the atomic kind <"// &
2537 CALL timestop(handle)
2539 END SUBROUTINE read_qs_kind
2546 SUBROUTINE check_potential_basis_compatibility(qs_kind)
2547 TYPE(qs_kind_type),
INTENT(INOUT) :: qs_kind
2549 CHARACTER(LEN=default_string_length) :: name
2551 TYPE(gth_potential_type),
POINTER :: gth_potential
2552 TYPE(gto_basis_set_type),
POINTER :: basis_set
2554 CALL get_qs_kind(qs_kind, name=name, gth_potential=gth_potential, basis_set=basis_set)
2557 IF (
ASSOCIATED(gth_potential)) &
2558 npp = parse_valence_electrons(gth_potential%aliases)
2559 IF (
ASSOCIATED(basis_set)) &
2560 nbs = parse_valence_electrons(basis_set%aliases)
2562 IF (npp >= 0 .AND. nbs >= 0 .AND. npp /= nbs) &
2563 CALL cp_abort(__location__,
"Basis-set and pseudo-potential of atomic kind '"//trim(name)//
"'"// &
2564 " were optimized for different valence electron numbers.")
2566 END SUBROUTINE check_potential_basis_compatibility
2574 FUNCTION parse_valence_electrons(string)
RESULT(n)
2575 CHARACTER(*) :: string
2578 INTEGER :: i, istat, j
2580 i = index(string,
"-Q", .true.)
2584 j = scan(string(i + 2:),
"- ")
2585 READ (string(i + 2:i + j),
'(I3)', iostat=istat) n
2586 IF (istat /= 0) n = -1
2601 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
2602 TYPE(atomic_kind_type),
DIMENSION(:),
POINTER :: atomic_kind_set
2603 TYPE(section_vals_type),
POINTER :: kind_section
2604 TYPE(mp_para_env_type),
POINTER :: para_env
2605 TYPE(section_vals_type),
POINTER :: force_env_section
2607 CHARACTER(len=*),
PARAMETER :: routinen =
'create_qs_kind_set'
2609 INTEGER :: handle, ikind, method, nkind, qs_method
2612 CALL timeset(routinen, handle)
2614 IF (
ASSOCIATED(qs_kind_set)) cpabort(
"create_qs_kind_set: qs_kind_set already associated")
2615 IF (.NOT.
ASSOCIATED(atomic_kind_set)) cpabort(
"create_qs_kind_set: atomic_kind_set not associated")
2621 IF (method ==
do_qs)
THEN
2623 SELECT CASE (qs_method)
2638 nkind =
SIZE(atomic_kind_set)
2639 ALLOCATE (qs_kind_set(nkind))
2642 qs_kind_set(ikind)%name = atomic_kind_set(ikind)%name
2643 qs_kind_set(ikind)%element_symbol = atomic_kind_set(ikind)%element_symbol
2644 qs_kind_set(ikind)%natom = atomic_kind_set(ikind)%natom
2645 CALL read_qs_kind(qs_kind_set(ikind), kind_section, para_env, force_env_section, no_fail, qs_method)
2648 CALL timestop(handle)
2659 SUBROUTINE check_qs_kind(qs_kind, dft_control, subsys_section)
2661 TYPE(qs_kind_type),
POINTER :: qs_kind
2662 TYPE(dft_control_type),
INTENT(IN) :: dft_control
2663 TYPE(section_vals_type),
POINTER :: subsys_section
2666 TYPE(qs_dftb_atom_type),
POINTER :: dftb_parameter
2667 TYPE(semi_empirical_type),
POINTER :: se_parameter
2668 TYPE(xtb_atom_type),
POINTER :: xtb_parameter
2670 IF (dft_control%qs_control%semi_empirical)
THEN
2671 CALL get_qs_kind(qs_kind, se_parameter=se_parameter)
2672 cpassert(
ASSOCIATED(se_parameter))
2676 ELSE IF (dft_control%qs_control%dftb)
THEN
2677 CALL get_qs_kind(qs_kind, dftb_parameter=dftb_parameter)
2678 cpassert(
ASSOCIATED(dftb_parameter))
2682 ELSE IF (dft_control%qs_control%xtb)
THEN
2683 CALL get_qs_kind(qs_kind, xtb_parameter=xtb_parameter)
2684 cpassert(
ASSOCIATED(xtb_parameter))
2688 END SUBROUTINE check_qs_kind
2698 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
2699 TYPE(dft_control_type),
INTENT(IN) :: dft_control
2700 TYPE(section_vals_type),
POINTER :: subsys_section
2702 CHARACTER(len=*),
PARAMETER :: routinen =
'check_qs_kind_set'
2704 INTEGER :: handle, ikind, nkind
2705 TYPE(qs_kind_type),
POINTER :: qs_kind
2707 CALL timeset(routinen, handle)
2708 IF (
ASSOCIATED(qs_kind_set))
THEN
2709 nkind =
SIZE(qs_kind_set)
2711 qs_kind => qs_kind_set(ikind)
2712 CALL check_qs_kind(qs_kind, dft_control, subsys_section)
2714 IF (dft_control%qs_control%xtb)
THEN
2715 CALL write_xtb_kab_param(qs_kind_set, subsys_section, &
2716 dft_control%qs_control%xtb_control)
2719 cpabort(
"The pointer qs_kind_set is not associated")
2721 CALL timestop(handle)
2730 SUBROUTINE write_xtb_kab_param(qs_kind_set, subsys_section, xtb_control)
2732 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
2733 TYPE(section_vals_type),
POINTER :: subsys_section
2734 TYPE(xtb_control_type),
POINTER :: xtb_control
2736 CHARACTER(LEN=default_string_length) :: aname, bname
2737 INTEGER :: ikind, io_unit, jkind, nkind, za, zb
2738 TYPE(cp_logger_type),
POINTER :: logger
2739 TYPE(qs_kind_type),
POINTER :: qs_kinda, qs_kindb
2740 TYPE(xtb_atom_type),
POINTER :: xtb_parameter_a, xtb_parameter_b
2745 "PRINT%KINDS/POTENTIAL"),
cp_p_file))
THEN
2748 IF (io_unit > 0)
THEN
2750 WRITE (io_unit,
"(/,T2,A)")
"xTB| Kab parameters"
2751 nkind =
SIZE(qs_kind_set)
2753 qs_kinda => qs_kind_set(ikind)
2754 CALL get_qs_kind(qs_kinda, xtb_parameter=xtb_parameter_a)
2756 DO jkind = ikind, nkind
2757 qs_kindb => qs_kind_set(jkind)
2758 CALL get_qs_kind(qs_kindb, xtb_parameter=xtb_parameter_b)
2760 WRITE (io_unit,
"(A,T10,A15,T25,A15,T71,F10.3)") &
2761 " Kab:", trim(aname), trim(bname),
xtb_set_kab(za, zb, xtb_control)
2771 END SUBROUTINE write_xtb_kab_param
2794 SUBROUTINE set_qs_kind(qs_kind, paw_atom, ghost, floating, hard_radius, hard0_radius, &
2795 covalent_radius, vdw_radius, lmax_rho0, zeff, &
2796 no_optimize, dispersion, u_minus_j, reltmat, &
2797 dftb_parameter, xtb_parameter, &
2798 elec_conf, pao_basis_size)
2800 TYPE(qs_kind_type),
INTENT(INOUT) :: qs_kind
2801 LOGICAL,
INTENT(IN),
OPTIONAL :: paw_atom, ghost, floating
2802 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: hard_radius, hard0_radius, &
2803 covalent_radius, vdw_radius
2804 INTEGER,
INTENT(IN),
OPTIONAL :: lmax_rho0
2805 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: zeff
2806 LOGICAL,
INTENT(IN),
OPTIONAL :: no_optimize
2807 TYPE(qs_atom_dispersion_type),
OPTIONAL,
POINTER :: dispersion
2808 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: u_minus_j
2809 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: reltmat
2810 TYPE(qs_dftb_atom_type),
OPTIONAL,
POINTER :: dftb_parameter
2811 TYPE(xtb_atom_type),
OPTIONAL,
POINTER :: xtb_parameter
2812 INTEGER,
DIMENSION(:),
INTENT(IN),
OPTIONAL :: elec_conf
2813 INTEGER,
INTENT(IN),
OPTIONAL :: pao_basis_size
2815 IF (
PRESENT(dftb_parameter)) qs_kind%dftb_parameter => dftb_parameter
2816 IF (
PRESENT(xtb_parameter)) qs_kind%xtb_parameter => xtb_parameter
2817 IF (
PRESENT(elec_conf))
THEN
2818 IF (
ASSOCIATED(qs_kind%elec_conf))
THEN
2819 DEALLOCATE (qs_kind%elec_conf)
2821 ALLOCATE (qs_kind%elec_conf(0:
SIZE(elec_conf) - 1))
2822 qs_kind%elec_conf(:) = elec_conf(:)
2824 IF (
PRESENT(paw_atom)) qs_kind%paw_atom = paw_atom
2825 IF (
PRESENT(hard_radius)) qs_kind%hard_radius = hard_radius
2826 IF (
PRESENT(hard0_radius)) qs_kind%hard0_radius = hard0_radius
2827 IF (
PRESENT(covalent_radius)) qs_kind%covalent_radius = covalent_radius
2828 IF (
PRESENT(vdw_radius)) qs_kind%vdw_radius = vdw_radius
2829 IF (
PRESENT(lmax_rho0)) qs_kind%lmax_rho0 = lmax_rho0
2830 IF (
PRESENT(zeff))
THEN
2831 IF (
ASSOCIATED(qs_kind%all_potential))
THEN
2832 CALL set_potential(potential=qs_kind%all_potential, zeff=zeff)
2833 ELSE IF (
ASSOCIATED(qs_kind%gth_potential))
THEN
2834 CALL set_potential(potential=qs_kind%gth_potential, zeff=zeff)
2835 ELSE IF (
ASSOCIATED(qs_kind%sgp_potential))
THEN
2836 CALL set_potential(potential=qs_kind%sgp_potential, zeff=zeff)
2839 IF (
PRESENT(ghost)) qs_kind%ghost = ghost
2841 IF (
PRESENT(floating)) qs_kind%floating = floating
2843 IF (
PRESENT(no_optimize)) qs_kind%no_optimize = no_optimize
2845 IF (
PRESENT(dispersion)) qs_kind%dispersion => dispersion
2847 IF (
PRESENT(u_minus_j))
THEN
2848 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
2849 qs_kind%dft_plus_u%u_minus_j = u_minus_j
2853 IF (
PRESENT(reltmat)) qs_kind%reltmat => reltmat
2855 IF (
PRESENT(pao_basis_size)) qs_kind%pao_basis_size = pao_basis_size
2867 SUBROUTINE write_qs_kind(qs_kind, kind_number, output_unit)
2869 TYPE(qs_kind_type),
POINTER :: qs_kind
2870 INTEGER,
INTENT(in) :: kind_number, output_unit
2872 CHARACTER(LEN=3) :: yon
2873 CHARACTER(LEN=default_string_length) :: basis_type, bstring
2876 TYPE(gto_basis_set_type),
POINTER :: tmp_basis
2878 IF (output_unit > 0)
THEN
2880 IF (
ASSOCIATED(qs_kind))
THEN
2881 WRITE (unit=output_unit, fmt=
"(/,T2,I2,A,T57,A,T75,I6)") &
2882 kind_number,
". Atomic kind: "//trim(qs_kind%name), &
2883 "Number of atoms: ", qs_kind%natom
2885 DO ibas = 1,
SIZE(qs_kind%basis_sets, 1)
2888 inumbas=ibas, basis_type=basis_type)
2890 SELECT CASE (basis_type)
2892 bstring =
"Basis Set"
2895 bstring =
"Orbital Basis Set"
2897 bstring =
"GAPW Soft Basis Set"
2900 bstring =
"Auxiliary Basis Set"
2902 bstring =
"Minimal Basis Set"
2904 bstring =
"RI Auxiliary Basis Set"
2906 bstring =
"Auxiliary Fit Basis Set"
2908 bstring =
"LRI Basis Set"
2910 bstring =
"LRI Basis Set for TDDFPT"
2912 bstring =
"RI XAS Basis Set"
2914 bstring =
"RI HFX Basis Set"
2923 IF (qs_kind%ghost)
THEN
2924 WRITE (unit=output_unit, fmt=
"(/,T6,A)") &
2925 "The atoms of this atomic kind are GHOST atoms!"
2927 IF (qs_kind%floating)
THEN
2928 WRITE (unit=output_unit, fmt=
"(/,T6,A)") &
2929 "The atoms of this atomic kind are FLOATING BASIS FUNCTIONS."
2931 IF (qs_kind%covalent_radius > 0.0_dp)
THEN
2932 WRITE (unit=output_unit, fmt=
"(/,T8,A,T71,F10.3)") &
2933 "Atomic covalent radius [Angstrom]:", &
2936 IF (qs_kind%vdw_radius > 0.0_dp)
THEN
2937 WRITE (unit=output_unit, fmt=
"(/,T8,A,T71,F10.3)") &
2938 "Atomic van der Waals radius [Angstrom]:", &
2941 IF (qs_kind%paw_atom)
THEN
2942 WRITE (unit=output_unit, fmt=
"(/,T6,A)") &
2943 "The atoms of this atomic kind are PAW atoms (GAPW):"
2944 WRITE (unit=output_unit, fmt=
"(T8,A,T71,F10.3)") &
2945 "Hard Gaussian function radius:", qs_kind%hard_radius, &
2946 "Rho0 radius:", qs_kind%hard0_radius, &
2947 "Maximum GTO radius used for PAW projector construction:", &
2948 qs_kind%max_rad_local
2951 basis_type=
"ORB_SOFT")
2955 IF (
ASSOCIATED(qs_kind%all_potential))
CALL write_potential(qs_kind%all_potential, output_unit)
2956 IF (
ASSOCIATED(qs_kind%gth_potential))
CALL write_potential(qs_kind%gth_potential, output_unit)
2957 IF (
ASSOCIATED(qs_kind%sgp_potential))
CALL write_potential(qs_kind%sgp_potential, output_unit)
2958 IF (
ASSOCIATED(qs_kind%tnadd_potential))
CALL write_potential(qs_kind%tnadd_potential, output_unit)
2959 IF (
ASSOCIATED(qs_kind%dft_plus_u))
THEN
2960 WRITE (unit=output_unit, fmt=
"(/,T6,A,/,T8,A,T76,I5,/,T8,A,T73,F8.3)") &
2961 "A DFT+U correction is applied to atoms of this atomic kind:", &
2962 "Angular quantum momentum number L:", qs_kind%dft_plus_u%l, &
2963 "U(eff) = (U - J) value in [eV]:", qs_kind%dft_plus_u%u_minus_j_target*
evolt
2964 IF (qs_kind%dft_plus_u%u_ramping > 0.0_dp)
THEN
2965 IF (qs_kind%dft_plus_u%init_u_ramping_each_scf)
THEN
2970 WRITE (unit=output_unit, fmt=
"(T8,A,T73,F8.3,/,T8,A,T73,ES8.1,/,T8,A,T78,A3)") &
2971 "Increment for U ramping in [eV]:", qs_kind%dft_plus_u%u_ramping*
evolt, &
2972 "SCF threshold value for U ramping:", qs_kind%dft_plus_u%eps_u_ramping, &
2973 "Set U ramping value to zero before each wavefunction optimisation:", yon
2975 IF (
ASSOCIATED(qs_kind%dft_plus_u%orbitals))
THEN
2976 WRITE (unit=output_unit, fmt=
"(T8,A)") &
2977 "An initial orbital occupation is requested:"
2978 IF (
ASSOCIATED(qs_kind%dft_plus_u%nelec))
THEN
2979 IF (any(qs_kind%dft_plus_u%nelec(:) >= 0.5_dp))
THEN
2980 IF (
SIZE(qs_kind%dft_plus_u%nelec) > 1)
THEN
2981 WRITE (unit=output_unit, fmt=
"(T9,A,T75,F6.2)") &
2982 "Number of alpha electrons:", &
2983 qs_kind%dft_plus_u%nelec(1), &
2984 "Number of beta electrons:", &
2985 qs_kind%dft_plus_u%nelec(2)
2987 WRITE (unit=output_unit, fmt=
"(T9,A,T75,F6.2)") &
2988 "Number of electrons:", &
2989 qs_kind%dft_plus_u%nelec(1)
2993 WRITE (unit=output_unit, fmt=
"(T9,A,(T78,I3))") &
2994 "Preferred (initial) orbital occupation order (orbital M values):", &
2995 qs_kind%dft_plus_u%orbitals(:)
2996 WRITE (unit=output_unit, fmt=
"(T9,A,T71,ES10.3,/,T9,A,T76,I5)") &
2997 "Threshold value for the SCF convergence criterion:", &
2998 qs_kind%dft_plus_u%eps_scf, &
2999 "Number of initial SCF iterations:", &
3000 qs_kind%dft_plus_u%max_scf
3001 IF (qs_kind%dft_plus_u%smear)
THEN
3002 WRITE (unit=output_unit, fmt=
"(T9,A)") &
3003 "A smearing of the orbital occupations will be performed"
3013 END SUBROUTINE write_qs_kind
3023 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
3024 TYPE(section_vals_type),
POINTER :: subsys_section
3026 CHARACTER(len=*),
PARAMETER :: routinen =
'write_qs_kind_set'
3028 INTEGER :: handle, ikind, nkind, output_unit
3029 TYPE(cp_logger_type),
POINTER :: logger
3030 TYPE(qs_kind_type),
POINTER :: qs_kind
3032 CALL timeset(routinen, handle)
3037 "PRINT%KINDS", extension=
".Log")
3038 IF (output_unit > 0)
THEN
3039 IF (
ASSOCIATED(qs_kind_set))
THEN
3040 WRITE (unit=output_unit, fmt=
"(/,/,T2,A)")
"ATOMIC KIND INFORMATION"
3041 nkind =
SIZE(qs_kind_set)
3043 qs_kind => qs_kind_set(ikind)
3044 CALL write_qs_kind(qs_kind, ikind, output_unit)
3054 CALL timestop(handle)
3069 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
3070 TYPE(section_vals_type),
POINTER :: subsys_section
3072 CHARACTER(LEN=*),
PARAMETER :: routinen =
'write_gto_basis_sets'
3074 CHARACTER(LEN=default_string_length) :: basis_type, bstring
3075 INTEGER :: handle, ibas, ikind, nkind, output_unit
3076 TYPE(cp_logger_type),
POINTER :: logger
3077 TYPE(gto_basis_set_type),
POINTER :: tmp_basis
3078 TYPE(qs_kind_type),
POINTER :: qs_kind
3080 CALL timeset(routinen, handle)
3085 "PRINT%KINDS/BASIS_SET", &
3087 IF (output_unit > 0)
THEN
3088 IF (
ASSOCIATED(qs_kind_set))
THEN
3089 WRITE (unit=output_unit, fmt=
"(/,/,T2,A)") &
3090 "BASIS SET INFORMATION (Unnormalised Gaussian-type functions)"
3091 nkind =
SIZE(qs_kind_set)
3093 qs_kind => qs_kind_set(ikind)
3094 WRITE (unit=output_unit, fmt=
"(/,T2,I2,A)") &
3095 ikind,
". Atomic kind: "//trim(qs_kind%name)
3097 DO ibas = 1,
SIZE(qs_kind%basis_sets, 1)
3100 inumbas=ibas, basis_type=basis_type)
3101 IF (basis_type ==
"") cycle
3102 SELECT CASE (basis_type)
3104 bstring =
"Basis Set"
3106 bstring =
"Orbital Basis Set"
3108 bstring =
"GAPW Soft Basis Set"
3110 bstring =
"Auxiliary Basis Set"
3112 bstring =
"Minimal Basis Set"
3114 bstring =
"RI Auxiliary Basis Set"
3116 bstring =
"Auxiliary Fit Basis Set"
3118 bstring =
"LRI Basis Set"
3120 bstring =
"LRI Basis Set for TDDFPT"
3122 bstring =
"RI HFX Basis Set"
3136 "PRINT%KINDS/BASIS_SET")
3138 CALL timestop(handle)
3153 TYPE(atomic_kind_type),
INTENT(IN) :: atomic_kind
3154 TYPE(qs_kind_type),
INTENT(IN) :: qs_kind
3155 INTEGER,
DIMENSION(0:lmat, 10),
INTENT(OUT) :: ncalc, ncore, nelem
3156 REAL(kind=
dp),
DIMENSION(0:lmat, 10, 2), &
3157 INTENT(OUT) :: edelta
3159 INTEGER :: i, ii, is, l, ll, ne, nn, z
3160 INTEGER,
DIMENSION(:),
POINTER :: econf
3161 INTEGER,
DIMENSION(:, :),
POINTER :: addel, laddel, naddel
3162 LOGICAL :: bs_occupation
3163 REAL(kind=
dp) :: dmag, magnetization
3164 TYPE(gth_potential_type),
POINTER :: gth_potential
3165 TYPE(sgp_potential_type),
POINTER :: sgp_potential
3168 NULLIFY (gth_potential)
3170 gth_potential=gth_potential, &
3171 sgp_potential=sgp_potential, &
3172 magnetization=magnetization, &
3173 bs_occupation=bs_occupation, &
3174 addel=addel, laddel=laddel, naddel=naddel)
3181 IF (
ASSOCIATED(gth_potential))
THEN
3182 CALL get_potential(gth_potential, elec_conf=econf)
3184 ELSE IF (
ASSOCIATED(sgp_potential))
THEN
3185 CALL get_potential(sgp_potential, elec_conf=econf)
3188 DO l = 0, min(
lmat, ubound(
ptable(z)%e_conv, 1))
3203 ncalc = nelem - ncore
3209 IF (bs_occupation)
THEN
3211 DO i = 1,
SIZE(addel, 1)
3214 nn = naddel(i, is) - l
3217 DO ii =
SIZE(nelem, 2), 1, -1
3218 IF (ncalc(l, ii) > 0)
THEN
3219 IF ((ncalc(l, ii) + ne) < 2*(2*l + 1) + 1)
THEN
3220 edelta(l, ii, is) = edelta(l, ii, is) + ne
3223 edelta(l, ii + 1, is) = edelta(l, ii + 1, is) + ne
3227 ELSE IF (ii == 1)
THEN
3228 edelta(l, ii, is) = edelta(l, ii, is) + ne
3233 edelta(l, nn, is) = edelta(l, nn, is) + ne
3235 IF (ncalc(l, nn) + edelta(l, nn, is) < 0)
THEN
3236 edelta(l, nn, is) = -ncalc(l, nn)
3241 edelta = 0.5_dp*edelta
3242 ELSE IF (magnetization /= 0.0_dp)
THEN
3243 dmag = 0.5_dp*abs(magnetization)
3244 DO l = 0, min(
lmat, ubound(
ptable(z)%e_conv, 1))
3247 DO i = 1,
SIZE(ncalc, 2)
3248 IF (ncalc(l, i) == 0) cycle
3249 IF (ncalc(l, i) == ll) cycle
3250 IF (ncalc(l, i) > dmag .AND. (ll - ncalc(l, i)) > dmag)
THEN
3256 edelta(l, ii, 1) = magnetization*0.5_dp
3257 edelta(l, ii, 2) = -magnetization*0.5_dp
3262 CALL cp_abort(__location__, &
3263 "Magnetization value cannot be imposed for this atom type")
3267 IF (qs_kind%ghost .OR. qs_kind%floating)
THEN
3285 INTEGER,
DIMENSION(:),
POINTER :: econf
3286 INTEGER,
INTENT(IN) :: z
3287 INTEGER,
DIMENSION(0:lmat, 10),
INTENT(OUT) :: ncalc, ncore, nelem
3289 CHARACTER(LEN=default_string_length) :: message
3290 INTEGER :: ii, iounit, l, ll, lmin, nc, nn
3291 INTEGER,
DIMENSION(0:lmat) :: econfx
3292 TYPE(cp_logger_type),
POINTER :: logger
3299 econfx(0:
SIZE(econf) - 1) = econf
3300 IF (sum(econf) >= 0)
THEN
3301 lmin = min(
lmat, ubound(
ptable(z)%e_conv, 1))
3400 IF (z == 65 .AND. econfx(3) == 0)
THEN
3406 IF (ncore(0, 1) <= 0)
THEN
3407 IF (z >= 58 .AND. z <= 71)
THEN
3420 ncore(3, 1) = nc - 28
3421 message =
"A small-core pseudopotential with 4f-in-core is used for the lanthanide "// &
3423 cphint(trim(message))
3434 ncore(3, 1) = nc - 46
3435 message =
"A medium-core pseudopotential with 4f-in-core is used for the lanthanide "// &
3437 cphint(trim(message))
3444 IF (ncore(0, 1) >= 0)
THEN
3447 nn = sum(ncore(l, :)) + econfx(l)
3460 ncalc = nelem - ncore
3463 IF (iounit > 0)
THEN
3464 WRITE (iounit,
"(/,A,A2)")
"WARNING: Core states irregular for atom type ",
ptable(z)%symbol
3465 WRITE (iounit,
"(A,10I3)")
"WARNING: Redefine ELEC_CONF in the KIND section"
3466 cpabort(
"Incompatible Atomic Occupations Detected")
3470 lmin = min(
lmat, ubound(
ptable(z)%e_conv, 1))
3500 TYPE(qs_kind_type),
DIMENSION(:) :: qs_kind_set
3504 LOGICAL :: nlcc_present
3505 TYPE(gth_potential_type),
POINTER :: gth_potential
3506 TYPE(sgp_potential_type),
POINTER :: sgp_potential
3510 DO ikind = 1,
SIZE(qs_kind_set)
3511 CALL get_qs_kind(qs_kind_set(ikind), gth_potential=gth_potential, sgp_potential=sgp_potential)
3512 IF (
ASSOCIATED(gth_potential))
THEN
3513 CALL get_potential(potential=gth_potential, nlcc_present=nlcc_present)
3514 nlcc = nlcc .OR. nlcc_present
3515 ELSEIF (
ASSOCIATED(sgp_potential))
THEN
3516 CALL get_potential(potential=sgp_potential,
has_nlcc=nlcc_present)
3517 nlcc = nlcc .OR. nlcc_present
static int imax(int x, int y)
Returns the larger of two given integer (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
subroutine, public read_ecp_potential(element_symbol, potential, pseudo_name, pseudo_file, potential_section)
...
Routines that process Quantum Espresso UPF files.
subroutine, public atom_read_upf(pot, upf_filename, read_header)
...
pure subroutine, public atom_release_upf(upfpot)
...
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind(atomic_kind, fist_potential, element_symbol, name, mass, kind_number, natom, atom_list, rcov, rvdw, z, qeff, apol, cpol, mm_radius, shell, shell_active, damping)
Get attributes of an atomic kind.
subroutine, public remove_basis_set_container(basis)
...
subroutine, public remove_basis_from_container(container, inum, basis_type)
...
subroutine, public get_basis_from_container(container, basis_set, inumbas, basis_type)
Retrieve a basis set from the container.
subroutine, public add_basis_set_to_container(container, basis_set, basis_set_type)
...
subroutine, public write_orb_basis_set(orb_basis_set, output_unit, header)
Write a Gaussian-type orbital (GTO) basis set data set to the output unit.
subroutine, public deallocate_sto_basis_set(sto_basis_set)
...
subroutine, public init_aux_basis_set(gto_basis_set)
...
subroutine, public allocate_gto_basis_set(gto_basis_set)
...
subroutine, public combine_basis_sets(basis_set, basis_set_add)
...
subroutine, public write_gto_basis_set(gto_basis_set, output_unit, header)
Write a Gaussian-type orbital (GTO) basis set data set to the output unit.
subroutine, public allocate_sto_basis_set(sto_basis_set)
...
subroutine, public create_gto_from_sto_basis(sto_basis_set, gto_basis_set, ngauss, ortho)
...
subroutine, public read_sto_basis_set(element_symbol, basis_set_name, sto_basis_set, para_env, dft_section)
...
subroutine, public init_orb_basis_set(gto_basis_set)
Initialise a Gaussian-type orbital (GTO) basis set data set.
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)
...
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
various routines to log and control the output. The idea is that decisions about where to log should ...
integer function, public cp_logger_get_default_io_unit(logger)
returns the unit nr for the ionode (-1 on all other processors) skips as well checks if the procs cal...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
integer, parameter, public cp_p_file
integer function, public cp_print_key_should_output(iteration_info, basis_section, print_key_path, used_print_key, first_time)
returns what should be done with the given property if btest(res,cp_p_store) then the property should...
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
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
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, se_parameter, dftb_parameter, xtb_parameter, dftb3_param, 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_r3d_rs_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, ngrid_ang, ngrid_rad, lmax_rho0, dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, u_minus_j, U_of_dft_plus_u, J_of_dft_plus_u, alpha_of_dft_plus_u, beta_of_dft_plus_u, J0_of_dft_plus_u, occupation_of_dft_plus_u, dispersion, bs_occupation, magnetization, no_optimize, addel, laddel, naddel, orbitals, max_scf, eps_scf, smear, u_ramping, u_minus_j_target, eps_u_ramping, init_u_ramping_each_scf, reltmat, ghost, floating, name, element_symbol, pao_basis_size, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.
subroutine, public init_atom_electronic_state(atomic_kind, qs_kind, ncalc, ncore, nelem, edelta)
...
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, basis_type, total_zeff_corr)
Get attributes of an atomic kind set.
subroutine, public init_gapw_nlcc(qs_kind_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, reltmat, dftb_parameter, xtb_parameter, elec_conf, pao_basis_size)
Set the components of an atomic kind data set.
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 create_qs_kind_set(qs_kind_set, atomic_kind_set, kind_section, para_env, force_env_section)
Read an atomic kind set data set from the input file.
subroutine, public init_qs_kind_set(qs_kind_set)
Initialise an atomic kind set 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...
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, hen, zeta, occupation, electronegativity, chmax)
...
subroutine, public deallocate_xtb_atom_param(xtb_parameter)
...
subroutine, public write_xtb_atom_param(xtb_parameter, subsys_section)
...