94#include "./base/base_uses.f90"
100 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'cp_control_utils'
122 TYPE(
cell_type),
OPTIONAL,
POINTER :: cell
124 CHARACTER(len=default_path_length) :: basis_set_file_name, gauxc_model_name, &
125 intensities_file_name, &
127 CHARACTER(LEN=default_string_length), &
128 DIMENSION(:),
POINTER :: tmpstringlist
129 INTEGER :: admmtype, irep, isize, kg_tnadd_method, &
130 method_id, nrep, xc_deriv_method_id
131 LOGICAL :: at_end, do_hfx, do_ot, do_rpa_admm, do_rtp, exopt1, exopt2, exopt3, explicit, &
132 is_present, l_param, local_moment_possible, native_skala_grid, not_se, was_present
133 REAL(kind=
dp) :: density_cut, gradient_cut, tau_cut
134 REAL(kind=
dp),
DIMENSION(:),
POINTER :: pol
137 TYPE(
section_vals_type),
POINTER :: hairy_probes_section, hfx_section, kg_xc_fun_section, &
138 kg_xc_section, maxwell_section, sccs_section, scf_section, tmp_section, xc_fun_section, &
139 xc_gauxc_subsection, xc_section
141 was_present = .false.
145 NULLIFY (kg_xc_fun_section, kg_xc_section, tmp_section, xc_fun_section, xc_section, xc_gauxc_subsection)
146 ALLOCATE (dft_control)
152 SELECT CASE (method_id)
160 IF (.NOT. is_present .AND. not_se)
THEN
161 cpabort(
"XC section missing.")
168 IF (density_cut <= epsilon(0.0_dp)*100.0_dp)
THEN
169 CALL cp_warn(__location__, &
170 "DENSITY_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
171 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
173 density_cut = max(epsilon(0.0_dp)*100.0_dp, density_cut)
174 IF (gradient_cut <= epsilon(0.0_dp)*100.0_dp)
THEN
175 CALL cp_warn(__location__, &
176 "GRADIENT_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
177 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
179 gradient_cut = max(epsilon(0.0_dp)*100.0_dp, gradient_cut)
180 IF (tau_cut <= epsilon(0.0_dp)*100.0_dp)
THEN
181 CALL cp_warn(__location__, &
182 "TAU_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
183 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
185 tau_cut = max(epsilon(0.0_dp)*100.0_dp, tau_cut)
192 IF (.NOT. is_present .AND. not_se)
THEN
193 cpabort(
"XC_FUNCTIONAL section missing.")
196 dft_control%use_gauxc = .false.
205 IF (dft_control%uks .OR. dft_control%roks)
THEN
206 dft_control%nspins = 2
208 dft_control%nspins = 1
211 dft_control%lsd = (dft_control%nspins > 1)
213 IF (dft_control%use_gauxc)
THEN
214 native_skala_grid = .false.
217 gauxc_model_name = adjustl(gauxc_model_name)
219 IF (native_skala_grid .OR. &
220 (trim(gauxc_model_name) /=
"" .AND. trim(gauxc_model_name) /=
"NONE"))
THEN
221 dft_control%use_kinetic_energy_density = .true.
233 dft_control%use_kinetic_energy_density = dft_control%use_kinetic_energy_density .OR. &
245 IF (dft_control%do_fde)
THEN
247 associate(fde => dft_control%fde_control)
256 CALL section_vals_val_get(tmp_section,
"MOLCAS_INPUT_TEMPLATE", c_val=fde%molcas_input_template)
265 dft_control%drho_by_collocation = (
xc_uses_norm_drho(xc_fun_section, dft_control%lsd) &
267 IF (dft_control%drho_by_collocation)
THEN
268 cpabort(
"derivatives by collocation not implemented")
275 IF (
SIZE(tmpstringlist) == 2)
THEN
277 SELECT CASE (tmpstringlist(2))
279 SELECT CASE (tmpstringlist(1))
283 CALL cp_abort(__location__, &
284 "AUTO_BASIS: the size <X> is invalid for the "// &
285 "type <"//trim(adjustl(tmpstringlist(1)))//
">; "// &
286 "use one of SMALL, MEDIUM, LARGE, HUGE for "// &
287 "the size. The syntax AUTO_BASIS X X is a "// &
288 "reserved case for using NO automatically "// &
289 "generated basis sets.")
300 cpwarn(
"Unknown basis size in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
303 SELECT CASE (tmpstringlist(1))
306 dft_control%auto_basis_ri_aux = isize
308 dft_control%auto_basis_aux_fit = isize
310 dft_control%auto_basis_lri_aux = isize
312 dft_control%auto_basis_p_lri_aux = isize
314 dft_control%auto_basis_ri_hxc = isize
316 dft_control%auto_basis_ri_xas = isize
318 dft_control%auto_basis_ri_hfx = isize
320 cpwarn(
"Unknown basis type in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
323 CALL cp_abort(__location__, &
324 "AUTO_BASIS keyword in &DFT section has a wrong number of arguments.")
335 is_present = is_present .AND. (do_hfx .OR. do_rpa_admm)
337 dft_control%do_admm = is_present
338 dft_control%do_admm_mo = .false.
339 dft_control%do_admm_dm = .false.
345 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_TYPE", i_val=admmtype)
346 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", explicit=exopt1)
347 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%METHOD", explicit=exopt2)
348 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_SCALING_MODEL", explicit=exopt3)
349 dft_control%admm_control%admm_type = admmtype
350 SELECT CASE (admmtype)
352 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", i_val=method_id)
353 dft_control%admm_control%purification_method = method_id
354 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%METHOD", i_val=method_id)
355 dft_control%admm_control%method = method_id
356 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_SCALING_MODEL", i_val=method_id)
357 dft_control%admm_control%scaling_model = method_id
362 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", i_val=method_id)
363 dft_control%admm_control%purification_method = method_id
395 CALL cp_abort(__location__, &
396 "ADMM_TYPE keyword in &AUXILIARY_DENSITY_MATRIX_METHOD section has a wrong value.")
400 r_val=dft_control%admm_control%eps_filter)
402 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_CORRECTION_FUNC", i_val=method_id)
403 dft_control%admm_control%aux_exch_func = method_id
406 dft_control%admm_control%aux_exch_func_param = .false.
407 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_A1", explicit=explicit, &
408 r_val=dft_control%admm_control%aux_x_param(1))
409 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
410 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_A2", explicit=explicit, &
411 r_val=dft_control%admm_control%aux_x_param(2))
412 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
413 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_GAMMA", explicit=explicit, &
414 r_val=dft_control%admm_control%aux_x_param(3))
415 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
417 CALL read_admm_block_list(dft_control%admm_control, dft_section)
420 SELECT CASE (admmtype)
422 IF (exopt2)
CALL cp_warn(__location__, &
423 "Value of ADMM_PURIFICATION_METHOD keyword will be overwritten with ADMM_TYPE selections.")
424 IF (exopt3)
CALL cp_warn(__location__, &
425 "Value of EXCH_SCALING_MODEL keyword will be overwritten with ADMM_TYPE selections.")
427 IF (exopt1)
CALL cp_warn(__location__, &
428 "Value of METHOD keyword will be overwritten with ADMM_TYPE selections.")
429 IF (exopt2)
CALL cp_warn(__location__, &
430 "Value of METHOD keyword will be overwritten with ADMM_TYPE selections.")
431 IF (exopt3)
CALL cp_warn(__location__, &
432 "Value of EXCH_SCALING_MODEL keyword will be overwritten with ADMM_TYPE selections.")
441 cpabort(
"ADMM: Blocking and Merlot scaling are mutually exclusive.")
446 CALL cp_abort(__location__, &
447 "ADMM: In the case of METHOD=CHARGE_CONSTRAINED_PROJECTION, "// &
448 "ADMM_PURIFICATION_METHOD=NONE has to be set.")
454 cpabort(
"ADMM: Chosen purification requires BASIS_PROJECTION")
457 IF (.NOT. do_ot) cpabort(
"ADMM: MO-based purification requires OT.")
462 dft_control%do_admm_dm = .true.
464 dft_control%do_admm_mo = .true.
472 dft_control%restricted = (dft_control%roks .AND. l_param)
476 CALL section_vals_val_get(dft_section,
"RELAX_MULTIPLICITY", r_val=dft_control%relax_multiplicity)
477 IF (dft_control%relax_multiplicity > 0.0_dp)
THEN
478 IF (.NOT. dft_control%uks)
THEN
479 CALL cp_abort(__location__,
"The option RELAX_MULTIPLICITY is only valid for "// &
480 "unrestricted Kohn-Sham (UKS) calculations")
486 CALL section_vals_get(hairy_probes_section, n_repetition=nrep, explicit=is_present)
489 dft_control%hairy_probes = .true.
490 ALLOCATE (dft_control%probe(nrep))
491 CALL read_hairy_probes_sections(dft_control, hairy_probes_section)
498 dft_control%sic_method_id =
sic_none
499 dft_control%sic_scaling_a = 1.0_dp
500 dft_control%sic_scaling_b = 1.0_dp
503 dft_control%dft_plus_u = .false.
505 dft_control%plus_u_method_id = method_id
511 explicit=dft_control%mtlr_reference_scf_explicit)
512 IF (dft_control%mtlr_reference_scf_explicit)
THEN
514 l_val=dft_control%mtlr_reference_scf)
518 dft_control%smear = .false.
521 dft_control%correct_surf_dip = .false.
522 CALL section_vals_val_get(dft_section,
"SURFACE_DIPOLE_CORRECTION", l_val=dft_control%correct_surf_dip)
524 dft_control%pos_dir_surf_dip = -1.0_dp
528 dft_control%switch_surf_dip = .false.
529 dft_control%surf_dip_correct_switch = dft_control%correct_surf_dip
531 dft_control%correct_el_density_dip = .false.
532 CALL section_vals_val_get(dft_section,
"CORE_CORR_DIP", l_val=dft_control%correct_el_density_dip)
533 IF (dft_control%correct_el_density_dip)
THEN
534 IF (dft_control%correct_surf_dip)
THEN
537 dft_control%correct_el_density_dip = .false.
538 cpwarn(
"CORE_CORR_DIP keyword is activated only if SURFACE_DIPOLE_CORRECTION is TRUE")
543 c_val=basis_set_file_name)
545 c_val=potential_file_name)
550 i_val=dft_control%sic_method_id)
552 i_val=dft_control%sic_list_id)
554 r_val=dft_control%sic_scaling_a)
556 r_val=dft_control%sic_scaling_b)
562 CALL read_rtp_section(dft_control, tmp_section)
569 IF (dft_control%do_xas_calculation)
THEN
572 l_val=dft_control%do_xas_calculation)
576 CALL section_vals_get(tmp_section, explicit=dft_control%do_xas_tdp_calculation)
577 IF (dft_control%do_xas_tdp_calculation)
THEN
580 l_val=dft_control%do_xas_tdp_calculation)
584 dft_control%apply_efield = .false.
585 dft_control%apply_efield_field = .false.
586 dft_control%apply_vector_potential = .false.
590 ALLOCATE (dft_control%efield_fields(nrep))
591 CALL read_efield_sections(dft_control, tmp_section, cell)
593 IF (.NOT. dft_control%rtp_control%velocity_gauge)
THEN
594 dft_control%apply_efield_field = .true.
596 dft_control%apply_vector_potential = .true.
598 dft_control%rtp_control%vec_pot = dft_control%efield_fields(1)%efield%vec_pot_initial
601 dft_control%apply_efield = .true.
610 local_moment_possible = (dft_control%rtp_control%rtp_method ==
rtp_method_bse .OR. &
612 ((.NOT. dft_control%rtp_control%periodic) .AND. dft_control%rtp_control%linear_scaling)
613 IF (local_moment_possible .AND. (.NOT.
ASSOCIATED(dft_control%rtp_control%print_pol_elements)))
THEN
615 CALL guess_pol_elements(dft_control, &
616 dft_control%rtp_control%print_pol_elements)
622 CALL section_vals_get(tmp_section, explicit=dft_control%apply_period_efield)
623 IF (dft_control%apply_period_efield)
THEN
624 ALLOCATE (dft_control%period_efield)
626 dft_control%period_efield%polarisation(1:3) = pol(1:3)
627 IF (
PRESENT(cell))
THEN
628 IF (
ASSOCIATED(cell))
THEN
633 dft_control%period_efield%d_filter(1:3) = pol(1:3)
634 IF (
PRESENT(cell))
THEN
638 r_val=dft_control%period_efield%strength)
639 dft_control%period_efield%displacement_field = .false.
641 l_val=dft_control%period_efield%displacement_field)
647 IF (
SIZE(pol) > 1 .OR. pol(1) /= 0.0_dp)
THEN
649 IF (dft_control%period_efield%strength /= 0.0_dp .OR. intensities_file_name /=
"")
THEN
650 CALL cp_abort(__location__,
"[PERIODIC FIELD] Only one of INTENSITY, INTENSITY_LIST "// &
651 "or INTENSITIES_FILE_NAME can be specified.")
654 ALLOCATE (dft_control%period_efield%strength_list(
SIZE(pol)))
655 dft_control%period_efield%strength_list(1:
SIZE(pol)) = pol(1:
SIZE(pol))
658 IF (intensities_file_name /=
"")
THEN
660 IF (dft_control%period_efield%strength /= 0.0_dp)
THEN
661 CALL cp_abort(__location__,
"[PERIODIC FIELD] Only one of INTENSITY, INTENSITY_LIST "// &
662 "or INTENSITIES_FILE_NAME can be specified.")
675 cpabort(
"[PERIODIC FIELD] No intensities found in INTENSITIES_FILE_NAME")
678 ALLOCATE (dft_control%period_efield%strength_list(nrep))
683 READ (parser%input_line, *) dft_control%period_efield%strength_list(irep)
690 i_val=dft_control%period_efield%start_frame)
692 i_val=dft_control%period_efield%end_frame)
694 IF (dft_control%period_efield%end_frame /= -1)
THEN
698 IF (dft_control%period_efield%start_frame > dft_control%period_efield%end_frame)
THEN
699 cpabort(
"[PERIODIC FIELD] START_FRAME > END_FRAME")
700 ELSE IF (dft_control%period_efield%start_frame < 1)
THEN
701 cpabort(
"[PERIODIC FIELD] START_FRAME < 1")
702 ELSE IF (mod(dft_control%period_efield%end_frame - &
703 dft_control%period_efield%start_frame + 1,
SIZE(pol)) /= 0)
THEN
704 CALL cp_abort(__location__, &
705 "[PERIODIC FIELD] Number of active frames must be a multiple of the number of intensities")
711 CALL cp_abort(__location__, &
712 "Periodic efield cannot be used with RTP. When restarting a "// &
713 "run with periodic efield, set RESTART_RTP under &EXT_RESTART "// &
714 "section to .FALSE. explicitly if RESTART_DEFAULT is .TRUE.")
716 IF (dft_control%period_efield%displacement_field)
THEN
726 CALL section_vals_get(tmp_section, explicit=dft_control%apply_external_potential)
727 IF (dft_control%apply_external_potential)
THEN
730 l_val=dft_control%expot_control%read_from_cube)
732 l_val=dft_control%expot_control%static)
734 r_val=dft_control%expot_control%scaling_factor)
739 dft_control%expot_control%maxwell_solver = .true.
743 r_val=dft_control%maxwell_control%real_test)
745 i_val=dft_control%maxwell_control%int_test)
747 l_val=dft_control%maxwell_control%log_test)
749 dft_control%expot_control%maxwell_solver = .false.
759 l_val=dft_control%do_sccs)
760 IF (dft_control%do_sccs)
THEN
761 ALLOCATE (dft_control%sccs_control)
763 r_val=dft_control%sccs_control%epsilon_solvent)
765 r_val=dft_control%sccs_control%alpha_solvent)
767 r_val=dft_control%sccs_control%beta_solvent)
769 r_val=dft_control%sccs_control%delta_rho)
771 i_val=dft_control%sccs_control%derivative_method)
773 i_val=dft_control%sccs_control%method_id)
775 r_val=dft_control%sccs_control%eps_sccs)
777 r_val=dft_control%sccs_control%eps_scf)
779 r_val=dft_control%sccs_control%gamma_solvent)
781 i_val=dft_control%sccs_control%max_iter)
783 r_val=dft_control%sccs_control%mixing)
784 SELECT CASE (dft_control%sccs_control%method_id)
788 r_val=dft_control%sccs_control%rho_max)
790 r_val=dft_control%sccs_control%rho_min)
791 IF (dft_control%sccs_control%rho_max < dft_control%sccs_control%rho_min)
THEN
792 CALL cp_abort(__location__, &
793 "The SCCS parameter RHO_MAX is smaller than RHO_MIN. "// &
794 "Please, check your input!")
800 r_val=dft_control%sccs_control%beta)
801 IF (dft_control%sccs_control%beta < 0.5_dp)
THEN
802 CALL cp_abort(__location__, &
803 "A value smaller than 0.5 for the SCCS parameter beta "// &
804 "causes numerical problems. Please, check your input!")
807 r_val=dft_control%sccs_control%rho_zero)
812 IF (.NOT. is_present)
THEN
813 CALL cp_abort(__location__, &
814 "SCCS method SAA_ANDREUSSI requires the "// &
815 "SAA_ANDREUSSI section.")
817 IF (.NOT. all(cell%perd == 1))
THEN
818 CALL cp_abort(__location__, &
819 "SCCS method SAA_ANDREUSSI is only implemented for "// &
820 "3D periodic calculations.")
823 r_val=dft_control%sccs_control%rho_max)
825 r_val=dft_control%sccs_control%rho_min)
826 IF (dft_control%sccs_control%rho_max < dft_control%sccs_control%rho_min)
THEN
827 CALL cp_abort(__location__, &
828 "The SCCS parameter RHO_MAX is smaller than RHO_MIN. "// &
829 "Please, check your input!")
832 r_val=dft_control%sccs_control%f0)
834 r_val=dft_control%sccs_control%delta_eta)
836 r_val=dft_control%sccs_control%delta_zeta)
838 r_val=dft_control%sccs_control%r_solv)
840 r_val=dft_control%sccs_control%alpha_zeta)
844 cpabort(
"Invalid SCCS model specified. Please, check your input!")
856 l_val=dft_control%do_pcc)
857 IF (dft_control%do_pcc)
THEN
858 ALLOCATE (dft_control%pcc_control)
860 r_val=dft_control%pcc_control%dist_edge)
862 r_val=dft_control%pcc_control%gau_c)
864 i_val=dft_control%pcc_control%surf_normal)
874 l_val=dft_control%do_paep)
875 IF (dft_control%do_paep)
THEN
876 ALLOCATE (dft_control%paep_control)
878 i_val=dft_control%paep_control%surf_normal)
885 CALL section_vals_get(tmp_section, explicit=dft_control%apply_external_density)
907 TYPE(rixs_control_type),
POINTER :: rixs_control
908 TYPE(section_vals_type),
POINTER :: rixs_section
909 TYPE(qs_control_type),
POINTER :: qs_control
911 TYPE(section_vals_type),
POINTER :: td_section, xas_section
913 CALL section_vals_val_get(rixs_section,
"_SECTION_PARAMETERS_", l_val=rixs_control%enabled)
915 CALL section_vals_val_get(rixs_section,
"CORE_STATES", i_val=rixs_control%core_states)
916 CALL section_vals_val_get(rixs_section,
"VALENCE_STATES", i_val=rixs_control%valence_states)
918 td_section => section_vals_get_subs_vals(rixs_section,
"TDDFPT")
921 xas_section => section_vals_get_subs_vals(rixs_section,
"XAS_TDP")
922 CALL read_xas_tdp_control(rixs_control%xas_tdp_control, xas_section)
933 TYPE(qs_control_type),
INTENT(INOUT) :: qs_control
934 TYPE(section_vals_type),
POINTER :: dft_section
936 CHARACTER(len=*),
PARAMETER :: routinen =
'read_mgrid_section'
938 INTEGER :: handle, igrid_level, interp_kind, &
940 LOGICAL :: explicit, multigrid_set
942 REAL(dp),
DIMENSION(:),
POINTER :: cutofflist
943 TYPE(section_vals_type),
POINTER :: interp_section, mgrid_section
945 CALL timeset(routinen, handle)
947 NULLIFY (interp_section, mgrid_section, cutofflist)
948 mgrid_section => section_vals_get_subs_vals(dft_section,
"MGRID")
949 interp_section => section_vals_get_subs_vals(mgrid_section,
"INTERPOLATOR")
951 CALL section_vals_val_get(mgrid_section,
"NGRIDS", i_val=ngrid_level)
952 CALL section_vals_val_get(mgrid_section,
"MULTIGRID_SET", l_val=multigrid_set)
953 CALL section_vals_val_get(mgrid_section,
"CUTOFF", r_val=cutoff)
954 CALL section_vals_val_get(mgrid_section,
"PROGRESSION_FACTOR", r_val=qs_control%progression_factor)
955 CALL section_vals_val_get(mgrid_section,
"COMMENSURATE", l_val=qs_control%commensurate_mgrids)
956 CALL section_vals_val_get(interp_section,
"KIND", i_val=interp_kind)
957 IF (interp_kind /= pw_interp) qs_control%commensurate_mgrids = .true.
958 CALL section_vals_val_get(mgrid_section,
"REALSPACE", l_val=qs_control%realspace_mgrids)
959 CALL section_vals_val_get(mgrid_section,
"REL_CUTOFF", r_val=qs_control%relative_cutoff)
960 CALL section_vals_val_get(mgrid_section,
"SKIP_LOAD_BALANCE_DISTRIBUTED", &
961 l_val=qs_control%skip_load_balance_distributed)
964 IF (qs_control%semi_empirical .OR. qs_control%dftb .OR. qs_control%xtb)
THEN
966 multigrid_set = .false.
968 CALL section_vals_val_get(mgrid_section,
"CUTOFF", explicit=explicit, r_val=cutoff)
969 IF (.NOT. explicit) cutoff = 1.0_dp
972 ALLOCATE (qs_control%e_cutoff(ngrid_level))
973 qs_control%cutoff = cutoff
975 IF (multigrid_set)
THEN
977 IF (qs_control%commensurate_mgrids)
THEN
978 cpabort(
"Do not specify cutoffs for the commensurate grids (NYI)")
981 CALL section_vals_val_get(mgrid_section,
"MULTIGRID_CUTOFF", r_vals=cutofflist)
982 IF (
ASSOCIATED(cutofflist))
THEN
983 IF (
SIZE(cutofflist, 1) /= ngrid_level)
THEN
984 cpabort(
"Number of multi-grids requested and number of cutoff values do not match")
986 DO igrid_level = 1, ngrid_level
987 qs_control%e_cutoff(igrid_level) = cutofflist(igrid_level)
991 DO igrid_level = ngrid_level, 1, -1
992 IF (qs_control%cutoff <= qs_control%e_cutoff(igrid_level))
THEN
993 qs_control%cutoff = qs_control%e_cutoff(igrid_level)
997 IF (igrid_level == 1)
THEN
998 qs_control%cutoff = qs_control%e_cutoff(1)
1002 IF (qs_control%commensurate_mgrids) qs_control%progression_factor = 4.0_dp
1003 qs_control%e_cutoff(1) = qs_control%cutoff
1004 DO igrid_level = 2, ngrid_level
1005 qs_control%e_cutoff(igrid_level) = qs_control%e_cutoff(igrid_level - 1)/ &
1006 qs_control%progression_factor
1010 DO igrid_level = 2, ngrid_level
1011 IF (qs_control%e_cutoff(igrid_level) > qs_control%e_cutoff(igrid_level - 1))
THEN
1012 cpabort(
"The cutoff values for the multi-grids are not ordered from large to small")
1013 ELSE IF (qs_control%e_cutoff(igrid_level) == qs_control%e_cutoff(igrid_level - 1))
THEN
1014 cpabort(
"The same cutoff value was specified for two multi-grids")
1017 CALL timestop(handle)
1028 TYPE(qs_control_type),
INTENT(INOUT) :: qs_control
1029 TYPE(section_vals_type),
POINTER :: qs_section
1030 TYPE(cell_type),
OPTIONAL,
POINTER :: cell
1032 CHARACTER(len=*),
PARAMETER :: routinen =
'read_qs_section'
1034 CHARACTER(LEN=2) :: element_symbol
1035 CHARACTER(LEN=default_string_length) :: cval
1036 CHARACTER(LEN=default_string_length), &
1037 DIMENSION(:),
POINTER :: clist
1038 INTEGER :: handle, itmp, j, jj, k, n_rep, n_var, &
1039 ngauss, ngp, nrep, znum
1040 INTEGER,
DIMENSION(:),
POINTER :: tmplist
1041 LOGICAL :: dftb_scc_mixer_explicit, dftb_tblite_mixer_explicit, explicit, &
1042 tblite_reference_cli, tblite_reference_cli_section, tblite_section_active, was_present, &
1043 xtb_scc_mixer_explicit, xtb_tblite_mixer_explicit
1044 REAL(dp) :: tmp, tmpsqrt, value
1045 REAL(dp),
POINTER :: scal(:)
1046 TYPE(section_vals_type),
POINTER :: cdft_control_section, ddapc_restraint_section, &
1047 dftb_parameter, dftb_section, dftb_tblite_mixer, eeq_section, genpot_section, &
1048 lri_optbas_section, mull_section, nonbonded_section, s2_restraint_section, se_section, &
1049 xtb_parameter, xtb_section, xtb_tblite, xtb_tblite_mixer, xtb_tblite_ref_cli
1051 CALL timeset(routinen, handle)
1053 was_present = .false.
1054 NULLIFY (mull_section, ddapc_restraint_section, s2_restraint_section, &
1055 se_section, dftb_section, xtb_section, dftb_parameter, xtb_parameter, lri_optbas_section, &
1056 cdft_control_section, genpot_section, eeq_section, dftb_tblite_mixer, &
1057 xtb_tblite_mixer, xtb_tblite_ref_cli)
1059 mull_section => section_vals_get_subs_vals(qs_section,
"MULLIKEN_RESTRAINT")
1060 ddapc_restraint_section => section_vals_get_subs_vals(qs_section,
"DDAPC_RESTRAINT")
1061 s2_restraint_section => section_vals_get_subs_vals(qs_section,
"S2_RESTRAINT")
1062 se_section => section_vals_get_subs_vals(qs_section,
"SE")
1063 dftb_section => section_vals_get_subs_vals(qs_section,
"DFTB")
1064 xtb_section => section_vals_get_subs_vals(qs_section,
"xTB")
1065 dftb_parameter => section_vals_get_subs_vals(dftb_section,
"PARAMETER")
1066 dftb_tblite_mixer => section_vals_get_subs_vals(dftb_section,
"TBLITE_MIXER")
1067 xtb_parameter => section_vals_get_subs_vals(xtb_section,
"PARAMETER")
1068 eeq_section => section_vals_get_subs_vals(xtb_section,
"EEQ")
1069 lri_optbas_section => section_vals_get_subs_vals(qs_section,
"OPTIMIZE_LRI_BASIS")
1070 cdft_control_section => section_vals_get_subs_vals(qs_section,
"CDFT")
1071 nonbonded_section => section_vals_get_subs_vals(xtb_section,
"NONBONDED")
1072 genpot_section => section_vals_get_subs_vals(nonbonded_section,
"GENPOT")
1073 xtb_tblite_mixer => section_vals_get_subs_vals(xtb_section,
"TBLITE_MIXER")
1074 xtb_tblite => section_vals_get_subs_vals(xtb_section,
"TBLITE")
1075 xtb_tblite_ref_cli => section_vals_get_subs_vals(xtb_tblite,
"REFERENCE_CLI")
1079 CALL section_vals_val_get(qs_section,
"EPS_DEFAULT", r_val=
value)
1080 tmpsqrt = sqrt(
value)
1083 qs_control%eps_core_charge =
value/100.0_dp
1086 qs_control%eps_pgf_orb = tmpsqrt
1087 qs_control%eps_kg_orb = qs_control%eps_pgf_orb
1089 qs_control%eps_ppnl = qs_control%eps_pgf_orb/100.0_dp
1091 qs_control%eps_ppl = 1.0e-2_dp
1093 qs_control%gapw_control%eps_cpc =
value
1095 qs_control%eps_rho_gspace =
value
1096 qs_control%eps_rho_rspace =
value
1098 qs_control%eps_gvg_rspace = tmpsqrt
1100 CALL section_vals_val_get(qs_section,
"EPS_CORE_CHARGE", n_rep_val=n_rep)
1101 IF (n_rep /= 0)
THEN
1102 CALL section_vals_val_get(qs_section,
"EPS_CORE_CHARGE", r_val=qs_control%eps_core_charge)
1104 CALL section_vals_val_get(qs_section,
"EPS_GVG_RSPACE", n_rep_val=n_rep)
1105 IF (n_rep /= 0)
THEN
1106 CALL section_vals_val_get(qs_section,
"EPS_GVG_RSPACE", r_val=qs_control%eps_gvg_rspace)
1108 CALL section_vals_val_get(qs_section,
"EPS_PGF_ORB", n_rep_val=n_rep)
1109 IF (n_rep /= 0)
THEN
1110 CALL section_vals_val_get(qs_section,
"EPS_PGF_ORB", r_val=qs_control%eps_pgf_orb)
1112 CALL section_vals_val_get(qs_section,
"EPS_KG_ORB", n_rep_val=n_rep)
1113 IF (n_rep /= 0)
THEN
1114 CALL section_vals_val_get(qs_section,
"EPS_KG_ORB", r_val=tmp)
1115 qs_control%eps_kg_orb = sqrt(tmp)
1117 CALL section_vals_val_get(qs_section,
"EPS_PPL", n_rep_val=n_rep)
1118 IF (n_rep /= 0)
THEN
1119 CALL section_vals_val_get(qs_section,
"EPS_PPL", r_val=qs_control%eps_ppl)
1121 CALL section_vals_val_get(qs_section,
"EPS_PPNL", n_rep_val=n_rep)
1122 IF (n_rep /= 0)
THEN
1123 CALL section_vals_val_get(qs_section,
"EPS_PPNL", r_val=qs_control%eps_ppnl)
1125 CALL section_vals_val_get(qs_section,
"EPS_RHO", n_rep_val=n_rep)
1126 IF (n_rep /= 0)
THEN
1127 CALL section_vals_val_get(qs_section,
"EPS_RHO", r_val=qs_control%eps_rho_gspace)
1128 qs_control%eps_rho_rspace = qs_control%eps_rho_gspace
1130 CALL section_vals_val_get(qs_section,
"EPS_RHO_RSPACE", n_rep_val=n_rep)
1131 IF (n_rep /= 0)
THEN
1132 CALL section_vals_val_get(qs_section,
"EPS_RHO_RSPACE", r_val=qs_control%eps_rho_rspace)
1134 CALL section_vals_val_get(qs_section,
"EPS_RHO_GSPACE", n_rep_val=n_rep)
1135 IF (n_rep /= 0)
THEN
1136 CALL section_vals_val_get(qs_section,
"EPS_RHO_GSPACE", r_val=qs_control%eps_rho_gspace)
1138 CALL section_vals_val_get(qs_section,
"EPS_FILTER_MATRIX", n_rep_val=n_rep)
1139 IF (n_rep /= 0)
THEN
1140 CALL section_vals_val_get(qs_section,
"EPS_FILTER_MATRIX", r_val=qs_control%eps_filter_matrix)
1142 CALL section_vals_val_get(qs_section,
"EPS_CPC", n_rep_val=n_rep)
1143 IF (n_rep /= 0)
THEN
1144 CALL section_vals_val_get(qs_section,
"EPS_CPC", r_val=qs_control%gapw_control%eps_cpc)
1147 CALL section_vals_val_get(qs_section,
"EPSFIT", r_val=qs_control%gapw_control%eps_fit)
1148 CALL section_vals_val_get(qs_section,
"EPSISO", r_val=qs_control%gapw_control%eps_iso)
1149 CALL section_vals_val_get(qs_section,
"EPSSVD", r_val=qs_control%gapw_control%eps_svd)
1150 CALL section_vals_val_get(qs_section,
"EPSRHO0", r_val=qs_control%gapw_control%eps_Vrho0)
1151 CALL section_vals_val_get(qs_section,
"ALPHA0_HARD", r_val=qs_control%gapw_control%alpha0_hard)
1152 qs_control%gapw_control%alpha0_hard_from_input = .false.
1153 IF (qs_control%gapw_control%alpha0_hard /= 0.0_dp) qs_control%gapw_control%alpha0_hard_from_input = .true.
1154 CALL section_vals_val_get(qs_section,
"FORCE_PAW", l_val=qs_control%gapw_control%force_paw)
1155 CALL section_vals_val_get(qs_section,
"MAX_RAD_LOCAL", r_val=qs_control%gapw_control%max_rad_local)
1157 CALL section_vals_val_get(qs_section,
"MIN_PAIR_LIST_RADIUS", r_val=qs_control%pairlist_radius)
1159 CALL section_vals_val_get(qs_section,
"LS_SCF", l_val=qs_control%do_ls_scf)
1160 CALL section_vals_val_get(qs_section,
"ALMO_SCF", l_val=qs_control%do_almo_scf)
1161 CALL section_vals_val_get(qs_section,
"KG_METHOD", l_val=qs_control%do_kg)
1164 CALL section_vals_val_get(qs_section,
"REF_EMBED_SUBSYS", l_val=qs_control%ref_embed_subsys)
1165 CALL section_vals_val_get(qs_section,
"CLUSTER_EMBED_SUBSYS", l_val=qs_control%cluster_embed_subsys)
1166 CALL section_vals_val_get(qs_section,
"HIGH_LEVEL_EMBED_SUBSYS", l_val=qs_control%high_level_embed_subsys)
1167 CALL section_vals_val_get(qs_section,
"DFET_EMBEDDED", l_val=qs_control%dfet_embedded)
1168 CALL section_vals_val_get(qs_section,
"DMFET_EMBEDDED", l_val=qs_control%dmfet_embedded)
1171 CALL section_vals_val_get(qs_section,
"LMAXN1", i_val=qs_control%gapw_control%lmax_sphere)
1172 CALL section_vals_val_get(qs_section,
"LMAXN0", i_val=qs_control%gapw_control%lmax_rho0)
1173 CALL section_vals_val_get(qs_section,
"LADDN0", i_val=qs_control%gapw_control%ladd_rho0)
1174 CALL section_vals_val_get(qs_section,
"QUADRATURE", i_val=qs_control%gapw_control%quadrature)
1176 CALL section_vals_val_get(qs_section,
"GAPW_1C_BASIS", i_val=qs_control%gapw_control%basis_1c)
1177 IF (qs_control%gapw_control%basis_1c /= gapw_1c_orb)
THEN
1178 qs_control%gapw_control%eps_svd = max(qs_control%gapw_control%eps_svd, 1.e-12_dp)
1181 CALL section_vals_val_get(qs_section,
"GAPW_ACCURATE_XCINT", l_val=qs_control%gapw_control%accurate_xcint)
1182 CALL section_vals_val_get(qs_section,
"ALPHA_WEIGHTS", r_val=qs_control%gapw_control%aweights)
1183 CALL section_vals_val_get(qs_section,
"ORDER_WEIGHTS", i_val=qs_control%gapw_control%oweights)
1186 CALL section_vals_val_get(qs_section,
"PW_GRID", i_val=itmp)
1188 CASE (do_pwgrid_spherical)
1189 qs_control%pw_grid_opt%spherical = .true.
1190 qs_control%pw_grid_opt%fullspace = .false.
1191 CASE (do_pwgrid_ns_fullspace)
1192 qs_control%pw_grid_opt%spherical = .false.
1193 qs_control%pw_grid_opt%fullspace = .true.
1194 CASE (do_pwgrid_ns_halfspace)
1195 qs_control%pw_grid_opt%spherical = .false.
1196 qs_control%pw_grid_opt%fullspace = .false.
1200 CALL section_vals_val_get(qs_section,
"CORE_PPL", i_val=itmp)
1201 qs_control%do_ppl_method = itmp
1203 CALL section_vals_val_get(qs_section,
"PW_GRID_LAYOUT", i_vals=tmplist)
1204 qs_control%pw_grid_opt%distribution_layout = tmplist
1205 CALL section_vals_val_get(qs_section,
"PW_GRID_BLOCKED", i_val=qs_control%pw_grid_opt%blocked)
1208 CALL section_vals_val_get(qs_section,
"EXTRAPOLATION", i_val=qs_control%wf_interpolation_method_nr)
1209 CALL section_vals_val_get(qs_section,
"EXTRAPOLATION_ORDER", i_val=qs_control%wf_extrapolation_order)
1212 CALL section_vals_val_get(qs_section,
"METHOD", i_val=qs_control%method_id)
1213 qs_control%gapw = .false.
1214 qs_control%gapw_xc = .false.
1215 qs_control%gpw = .false.
1216 qs_control%pao = .false.
1217 qs_control%dftb = .false.
1218 qs_control%xtb = .false.
1219 qs_control%semi_empirical = .false.
1220 qs_control%ofgpw = .false.
1221 qs_control%lrigpw = .false.
1222 qs_control%rigpw = .false.
1223 SELECT CASE (qs_control%method_id)
1224 CASE (do_method_gapw)
1225 CALL cite_reference(lippert1999)
1226 CALL cite_reference(krack2000)
1227 qs_control%gapw = .true.
1228 CASE (do_method_gapw_xc)
1229 qs_control%gapw_xc = .true.
1230 CASE (do_method_gpw)
1231 CALL cite_reference(lippert1997)
1232 CALL cite_reference(vandevondele2005a)
1233 qs_control%gpw = .true.
1234 CASE (do_method_ofgpw)
1235 qs_control%ofgpw = .true.
1236 CASE (do_method_lrigpw)
1237 qs_control%lrigpw = .true.
1238 CASE (do_method_rigpw)
1239 qs_control%rigpw = .true.
1240 CASE (do_method_dftb)
1241 qs_control%dftb = .true.
1242 CALL cite_reference(porezag1995)
1243 CALL cite_reference(seifert1996)
1244 CASE (do_method_xtb)
1245 qs_control%xtb = .true.
1246 CALL cite_reference(grimme2017)
1247 CALL cite_reference(pracht2019)
1248 CASE (do_method_mndo)
1249 CALL cite_reference(dewar1977)
1250 qs_control%semi_empirical = .true.
1251 CASE (do_method_am1)
1252 CALL cite_reference(dewar1985)
1253 qs_control%semi_empirical = .true.
1254 CASE (do_method_pm3)
1255 CALL cite_reference(stewart1989)
1256 qs_control%semi_empirical = .true.
1257 CASE (do_method_pnnl)
1258 CALL cite_reference(schenter2008)
1259 qs_control%semi_empirical = .true.
1260 CASE (do_method_pm6)
1261 CALL cite_reference(stewart2007)
1262 qs_control%semi_empirical = .true.
1263 CASE (do_method_pm6fm)
1264 CALL cite_reference(vanvoorhis2015)
1265 qs_control%semi_empirical = .true.
1266 CASE (do_method_pdg)
1267 CALL cite_reference(repasky2002)
1268 qs_control%semi_empirical = .true.
1269 CASE (do_method_rm1)
1270 CALL cite_reference(rocha2006)
1271 qs_control%semi_empirical = .true.
1272 CASE (do_method_mndod)
1273 CALL cite_reference(dewar1977)
1274 CALL cite_reference(thiel1992)
1275 qs_control%semi_empirical = .true.
1278 CALL section_vals_get(mull_section, explicit=qs_control%mulliken_restraint)
1280 IF (qs_control%mulliken_restraint)
THEN
1281 CALL section_vals_val_get(mull_section,
"STRENGTH", r_val=qs_control%mulliken_restraint_control%strength)
1282 CALL section_vals_val_get(mull_section,
"TARGET", r_val=qs_control%mulliken_restraint_control%target)
1283 CALL section_vals_val_get(mull_section,
"ATOMS", n_rep_val=n_rep)
1286 CALL section_vals_val_get(mull_section,
"ATOMS", i_rep_val=k, i_vals=tmplist)
1287 jj = jj +
SIZE(tmplist)
1289 qs_control%mulliken_restraint_control%natoms = jj
1290 IF (qs_control%mulliken_restraint_control%natoms < 1)
THEN
1291 cpabort(
"Need at least 1 atom to use mulliken constraints")
1293 ALLOCATE (qs_control%mulliken_restraint_control%atoms(qs_control%mulliken_restraint_control%natoms))
1296 CALL section_vals_val_get(mull_section,
"ATOMS", i_rep_val=k, i_vals=tmplist)
1297 DO j = 1,
SIZE(tmplist)
1299 qs_control%mulliken_restraint_control%atoms(jj) = tmplist(j)
1303 CALL section_vals_get(ddapc_restraint_section, n_repetition=nrep, explicit=qs_control%ddapc_restraint)
1304 IF (qs_control%ddapc_restraint)
THEN
1305 ALLOCATE (qs_control%ddapc_restraint_control(nrep))
1307 qs_control%ddapc_restraint_is_spin = .false.
1308 qs_control%ddapc_explicit_potential = .false.
1311 CALL section_vals_get(s2_restraint_section, explicit=qs_control%s2_restraint)
1312 IF (qs_control%s2_restraint)
THEN
1313 CALL section_vals_val_get(s2_restraint_section,
"STRENGTH", &
1314 r_val=qs_control%s2_restraint_control%strength)
1315 CALL section_vals_val_get(s2_restraint_section,
"TARGET", &
1316 r_val=qs_control%s2_restraint_control%target)
1317 CALL section_vals_val_get(s2_restraint_section,
"FUNCTIONAL_FORM", &
1318 i_val=qs_control%s2_restraint_control%functional_form)
1321 CALL section_vals_get(cdft_control_section, explicit=qs_control%cdft)
1322 IF (qs_control%cdft)
THEN
1323 CALL read_cdft_control_section(qs_control, cdft_control_section)
1327 IF (qs_control%semi_empirical)
THEN
1328 CALL section_vals_val_get(se_section,
"ORTHOGONAL_BASIS", &
1329 l_val=qs_control%se_control%orthogonal_basis)
1330 CALL section_vals_val_get(se_section,
"DELTA", &
1331 r_val=qs_control%se_control%delta)
1332 CALL section_vals_val_get(se_section,
"ANALYTICAL_GRADIENTS", &
1333 l_val=qs_control%se_control%analytical_gradients)
1334 CALL section_vals_val_get(se_section,
"FORCE_KDSO-D_EXCHANGE", &
1335 l_val=qs_control%se_control%force_kdsod_EX)
1337 CALL section_vals_val_get(se_section,
"INTEGRAL_SCREENING", &
1338 i_val=qs_control%se_control%integral_screening)
1339 IF (qs_control%method_id == do_method_pnnl)
THEN
1340 IF (qs_control%se_control%integral_screening /= do_se_is_slater)
THEN
1341 CALL cp_warn(__location__, &
1342 "PNNL semi-empirical parameterization supports only the Slater type "// &
1343 "integral scheme. Revert to Slater and continue the calculation.")
1345 qs_control%se_control%integral_screening = do_se_is_slater
1348 CALL section_vals_val_get(se_section,
"GA%NCELLS", &
1349 i_val=qs_control%se_control%ga_ncells)
1351 CALL section_vals_val_get(se_section,
"LR_CORRECTION%CUTOFF", &
1352 r_val=qs_control%se_control%cutoff_lrc)
1353 qs_control%se_control%taper_lrc = qs_control%se_control%cutoff_lrc
1354 CALL section_vals_val_get(se_section,
"LR_CORRECTION%RC_TAPER", &
1357 CALL section_vals_val_get(se_section,
"LR_CORRECTION%RC_TAPER", &
1358 r_val=qs_control%se_control%taper_lrc)
1360 CALL section_vals_val_get(se_section,
"LR_CORRECTION%RC_RANGE", &
1361 r_val=qs_control%se_control%range_lrc)
1363 CALL section_vals_val_get(se_section,
"COULOMB%CUTOFF", &
1364 r_val=qs_control%se_control%cutoff_cou)
1365 qs_control%se_control%taper_cou = qs_control%se_control%cutoff_cou
1366 CALL section_vals_val_get(se_section,
"COULOMB%RC_TAPER", &
1369 CALL section_vals_val_get(se_section,
"COULOMB%RC_TAPER", &
1370 r_val=qs_control%se_control%taper_cou)
1372 CALL section_vals_val_get(se_section,
"COULOMB%RC_RANGE", &
1373 r_val=qs_control%se_control%range_cou)
1375 CALL section_vals_val_get(se_section,
"EXCHANGE%CUTOFF", &
1376 r_val=qs_control%se_control%cutoff_exc)
1377 qs_control%se_control%taper_exc = qs_control%se_control%cutoff_exc
1378 CALL section_vals_val_get(se_section,
"EXCHANGE%RC_TAPER", &
1381 CALL section_vals_val_get(se_section,
"EXCHANGE%RC_TAPER", &
1382 r_val=qs_control%se_control%taper_exc)
1384 CALL section_vals_val_get(se_section,
"EXCHANGE%RC_RANGE", &
1385 r_val=qs_control%se_control%range_exc)
1387 IF (qs_control%se_control%integral_screening == do_se_is_kdso_d)
THEN
1388 CALL section_vals_val_get(se_section,
"SCREENING%RC_TAPER", &
1389 r_val=qs_control%se_control%taper_scr)
1390 CALL section_vals_val_get(se_section,
"SCREENING%RC_RANGE", &
1391 r_val=qs_control%se_control%range_scr)
1394 CALL section_vals_val_get(se_section,
"PERIODIC", &
1395 i_val=qs_control%se_control%periodic_type)
1396 SELECT CASE (qs_control%se_control%periodic_type)
1397 CASE (do_se_lr_none)
1398 qs_control%se_control%do_ewald = .false.
1399 qs_control%se_control%do_ewald_r3 = .false.
1400 qs_control%se_control%do_ewald_gks = .false.
1401 CASE (do_se_lr_ewald)
1402 qs_control%se_control%do_ewald = .true.
1403 qs_control%se_control%do_ewald_r3 = .false.
1404 qs_control%se_control%do_ewald_gks = .false.
1405 CASE (do_se_lr_ewald_gks)
1406 qs_control%se_control%do_ewald = .false.
1407 qs_control%se_control%do_ewald_r3 = .false.
1408 qs_control%se_control%do_ewald_gks = .true.
1409 IF (qs_control%method_id /= do_method_pnnl)
THEN
1410 CALL cp_abort(__location__, &
1411 "A periodic semi-empirical calculation was requested with a long-range "// &
1412 "summation on the single integral evaluation. This scheme is supported "// &
1413 "only by the PNNL parameterization.")
1415 CASE (do_se_lr_ewald_r3)
1416 qs_control%se_control%do_ewald = .true.
1417 qs_control%se_control%do_ewald_r3 = .true.
1418 qs_control%se_control%do_ewald_gks = .false.
1419 IF (qs_control%se_control%integral_screening /= do_se_is_kdso)
THEN
1420 CALL cp_abort(__location__, &
1421 "A periodic semi-empirical calculation was requested with a long-range "// &
1422 "summation for the slowly convergent part 1/R^3, which is not congruent "// &
1423 "with the integral screening chosen. The only integral screening supported "// &
1424 "by this periodic type calculation is the standard Klopman-Dewar-Sabelli-Ohno.")
1429 CALL section_vals_val_get(se_section,
"DISPERSION", &
1430 l_val=qs_control%se_control%dispersion)
1431 CALL section_vals_val_get(se_section,
"DISPERSION_RADIUS", &
1432 r_val=qs_control%se_control%rcdisp)
1433 CALL section_vals_val_get(se_section,
"COORDINATION_CUTOFF", &
1434 r_val=qs_control%se_control%epscn)
1435 CALL section_vals_val_get(se_section,
"D3_SCALING", r_vals=scal)
1436 qs_control%se_control%sd3(1) = scal(1)
1437 qs_control%se_control%sd3(2) = scal(2)
1438 qs_control%se_control%sd3(3) = scal(3)
1439 CALL section_vals_val_get(se_section,
"DISPERSION_PARAMETER_FILE", &
1440 c_val=qs_control%se_control%dispersion_parameter_file)
1443 IF (qs_control%se_control%periodic_type == do_se_lr_ewald_r3)
THEN
1444 cpabort(
"EWALD_R3 not implemented yet!")
1447 IF (qs_control%method_id == do_method_mndo .OR. &
1448 qs_control%method_id == do_method_am1 .OR. &
1449 qs_control%method_id == do_method_mndod .OR. &
1450 qs_control%method_id == do_method_pdg .OR. &
1451 qs_control%method_id == do_method_pm3 .OR. &
1452 qs_control%method_id == do_method_pm6 .OR. &
1453 qs_control%method_id == do_method_pm6fm .OR. &
1454 qs_control%method_id == do_method_pnnl .OR. &
1455 qs_control%method_id == do_method_rm1)
THEN
1456 qs_control%se_control%orthogonal_basis = .true.
1461 IF (qs_control%dftb)
THEN
1462 CALL section_vals_val_get(dftb_section,
"ORTHOGONAL_BASIS", &
1463 l_val=qs_control%dftb_control%orthogonal_basis)
1464 CALL section_vals_val_get(dftb_section,
"SELF_CONSISTENT", &
1465 l_val=qs_control%dftb_control%self_consistent)
1466 CALL section_vals_val_get(dftb_section,
"DISPERSION", &
1467 l_val=qs_control%dftb_control%dispersion)
1468 CALL section_vals_val_get(dftb_section,
"DIAGONAL_DFTB3", &
1469 l_val=qs_control%dftb_control%dftb3_diagonal)
1470 CALL section_vals_val_get(dftb_section,
"HB_SR_GAMMA", &
1471 l_val=qs_control%dftb_control%hb_sr_damp)
1472 CALL section_vals_val_get(dftb_section,
"SCC_MIXER", &
1473 explicit=dftb_scc_mixer_explicit)
1474 CALL section_vals_val_get(dftb_section,
"SCC_MIXER", &
1475 i_val=qs_control%dftb_control%tblite_scc_mixer)
1476 CALL section_vals_get(dftb_tblite_mixer, explicit=dftb_tblite_mixer_explicit)
1477 CALL read_tblite_mixer_section(dftb_tblite_mixer, &
1478 qs_control%dftb_control%tblite_mixer_iterations, &
1479 qs_control%dftb_control%tblite_mixer_memory, &
1480 qs_control%dftb_control%tblite_mixer_solver, &
1481 qs_control%dftb_control%tblite_mixer_damping, &
1482 qs_control%dftb_control%tblite_mixer_omega0, &
1483 qs_control%dftb_control%tblite_mixer_min_weight, &
1484 qs_control%dftb_control%tblite_mixer_max_weight, &
1485 qs_control%dftb_control%tblite_mixer_weight_factor, &
1486 "DFTB/TBLITE_MIXER")
1487 IF (qs_control%do_ls_scf)
THEN
1488 IF (dftb_scc_mixer_explicit .AND. &
1489 qs_control%dftb_control%tblite_scc_mixer /= tblite_scc_mixer_none)
THEN
1490 CALL cp_warn(__location__, &
1491 "DFTB/SCC_MIXER is reset to NONE with QS/LS_SCF; LS_SCF optimizes "// &
1492 "the density matrix directly.")
1494 IF (dftb_tblite_mixer_explicit)
THEN
1495 CALL cp_warn(__location__, &
1496 "DFTB/TBLITE_MIXER settings are ignored with QS/LS_SCF; LS_SCF controls "// &
1497 "the density-matrix optimization.")
1499 qs_control%dftb_control%tblite_scc_mixer = tblite_scc_mixer_none
1501 IF (qs_control%dftb_control%tblite_mixer_damping <= 0.0_dp)
THEN
1502 cpabort(
"DFTB/TBLITE_MIXER/DAMPING must be positive")
1504 CALL section_vals_val_get(dftb_section,
"EPS_DISP", &
1505 r_val=qs_control%dftb_control%eps_disp)
1506 CALL section_vals_val_get(dftb_section,
"DO_EWALD", explicit=explicit)
1508 CALL section_vals_val_get(dftb_section,
"DO_EWALD", &
1509 l_val=qs_control%dftb_control%do_ewald)
1511 qs_control%dftb_control%do_ewald = (qs_control%periodicity /= 0)
1513 CALL section_vals_val_get(dftb_parameter,
"PARAM_FILE_PATH", &
1514 c_val=qs_control%dftb_control%sk_file_path)
1515 CALL section_vals_val_get(dftb_parameter,
"PARAM_FILE_NAME", &
1516 c_val=qs_control%dftb_control%sk_file_list)
1517 CALL section_vals_val_get(dftb_parameter,
"HB_SR_PARAM", &
1518 r_val=qs_control%dftb_control%hb_sr_para)
1519 CALL section_vals_val_get(dftb_parameter,
"SK_FILE", n_rep_val=n_var)
1520 ALLOCATE (qs_control%dftb_control%sk_pair_list(3, n_var))
1522 CALL section_vals_val_get(dftb_parameter,
"SK_FILE", i_rep_val=k, &
1524 qs_control%dftb_control%sk_pair_list(1:3, k) = clist(1:3)
1527 CALL section_vals_val_get(dftb_parameter,
"DISPERSION_TYPE", &
1528 i_val=qs_control%dftb_control%dispersion_type)
1529 CALL section_vals_val_get(dftb_parameter,
"UFF_FORCE_FIELD", &
1530 c_val=qs_control%dftb_control%uff_force_field)
1532 CALL section_vals_val_get(dftb_parameter,
"DISPERSION_RADIUS", &
1533 r_val=qs_control%dftb_control%rcdisp)
1534 CALL section_vals_val_get(dftb_parameter,
"COORDINATION_CUTOFF", &
1535 r_val=qs_control%dftb_control%epscn)
1536 CALL section_vals_val_get(dftb_parameter,
"D2_EXP_PRE", &
1537 r_val=qs_control%dftb_control%exp_pre)
1538 CALL section_vals_val_get(dftb_parameter,
"D2_SCALING", &
1539 r_val=qs_control%dftb_control%scaling)
1540 CALL section_vals_val_get(dftb_parameter,
"D3_SCALING", r_vals=scal)
1541 qs_control%dftb_control%sd3(1) = scal(1)
1542 qs_control%dftb_control%sd3(2) = scal(2)
1543 qs_control%dftb_control%sd3(3) = scal(3)
1544 CALL section_vals_val_get(dftb_parameter,
"D3BJ_SCALING", r_vals=scal)
1545 qs_control%dftb_control%sd3bj(1) = scal(1)
1546 qs_control%dftb_control%sd3bj(2) = scal(2)
1547 qs_control%dftb_control%sd3bj(3) = scal(3)
1548 qs_control%dftb_control%sd3bj(4) = scal(4)
1549 CALL section_vals_val_get(dftb_parameter,
"DISPERSION_PARAMETER_FILE", &
1550 c_val=qs_control%dftb_control%dispersion_parameter_file)
1552 IF (qs_control%dftb_control%dispersion)
CALL cite_reference(zhechkov2005)
1553 IF (qs_control%dftb_control%self_consistent)
CALL cite_reference(elstner1998)
1554 IF (qs_control%dftb_control%hb_sr_damp)
CALL cite_reference(hu2007)
1558 IF (qs_control%xtb)
THEN
1559 CALL section_vals_val_get(xtb_section,
"GFN_TYPE", i_val=qs_control%xtb_control%gfn_type)
1560 CALL section_vals_val_get(xtb_tblite,
"_SECTION_PARAMETERS_", l_val=tblite_section_active)
1561 qs_control%xtb_control%do_tblite = (qs_control%xtb_control%gfn_type == gfn_tblite)
1562 IF (qs_control%xtb_control%do_tblite)
THEN
1563 IF (.NOT. tblite_section_active)
THEN
1564 cpabort(
"XTB/GFN_TYPE TBLITE requires an XTB/TBLITE section")
1567 qs_control%xtb_control%gfn_type = gfn1xtb
1568 ELSE IF (tblite_section_active)
THEN
1569 cpabort(
"The XTB/TBLITE section requires XTB/GFN_TYPE TBLITE")
1571 CALL section_vals_val_get(xtb_section,
"SCC_MIXER", &
1572 explicit=xtb_scc_mixer_explicit)
1573 CALL section_vals_val_get(xtb_section,
"SCC_MIXER", &
1574 i_val=qs_control%xtb_control%tblite_scc_mixer)
1575 CALL section_vals_get(xtb_tblite_mixer, explicit=xtb_tblite_mixer_explicit)
1576 CALL read_tblite_mixer_section(xtb_tblite_mixer, &
1577 qs_control%xtb_control%tblite_mixer_iterations, &
1578 qs_control%xtb_control%tblite_mixer_memory, &
1579 qs_control%xtb_control%tblite_mixer_solver, &
1580 qs_control%xtb_control%tblite_mixer_damping, &
1581 qs_control%xtb_control%tblite_mixer_omega0, &
1582 qs_control%xtb_control%tblite_mixer_min_weight, &
1583 qs_control%xtb_control%tblite_mixer_max_weight, &
1584 qs_control%xtb_control%tblite_mixer_weight_factor, &
1586 IF (xtb_tblite_mixer_explicit)
THEN
1587 CALL section_vals_val_get(xtb_tblite_mixer,
"DAMPING", &
1588 explicit=qs_control%xtb_control%tblite_mixer_damping_explicit)
1590 IF ((.NOT. qs_control%xtb_control%do_tblite) .AND. &
1591 qs_control%xtb_control%gfn_type == 0)
THEN
1592 IF (xtb_scc_mixer_explicit .AND. &
1593 qs_control%xtb_control%tblite_scc_mixer /= tblite_scc_mixer_auto .AND. &
1594 qs_control%xtb_control%tblite_scc_mixer /= tblite_scc_mixer_none)
THEN
1595 CALL cp_warn(__location__, &
1596 "XTB/SCC_MIXER is reset to NONE for CP2K-internal GFN0-xTB; "// &
1597 "GFN0-xTB has no SCC variables to mix.")
1599 IF (xtb_tblite_mixer_explicit)
THEN
1600 CALL cp_warn(__location__, &
1601 "XTB/TBLITE_MIXER settings are ignored for CP2K-internal GFN0-xTB; "// &
1602 "GFN0-xTB has no SCC variables to mix.")
1604 qs_control%xtb_control%tblite_scc_mixer = tblite_scc_mixer_none
1606 IF (qs_control%do_ls_scf)
THEN
1607 IF (xtb_scc_mixer_explicit .AND. &
1608 qs_control%xtb_control%tblite_scc_mixer /= tblite_scc_mixer_none)
THEN
1609 CALL cp_warn(__location__, &
1610 "XTB/SCC_MIXER is reset to NONE with QS/LS_SCF; LS_SCF optimizes "// &
1611 "the density matrix directly.")
1613 IF (xtb_tblite_mixer_explicit)
THEN
1614 CALL cp_warn(__location__, &
1615 "XTB/TBLITE_MIXER settings are ignored with QS/LS_SCF; LS_SCF controls "// &
1616 "the density-matrix optimization.")
1618 qs_control%xtb_control%tblite_scc_mixer = tblite_scc_mixer_none
1620 IF (qs_control%xtb_control%tblite_mixer_damping <= 0.0_dp)
THEN
1621 cpabort(
"XTB/TBLITE_MIXER/DAMPING must be positive")
1623 CALL section_vals_val_get(xtb_section,
"DO_EWALD", explicit=explicit)
1625 CALL section_vals_val_get(xtb_section,
"DO_EWALD", &
1626 l_val=qs_control%xtb_control%do_ewald)
1628 qs_control%xtb_control%do_ewald = (qs_control%periodicity /= 0)
1631 CALL section_vals_val_get(xtb_section,
"SPIN_POLARISATION", &
1632 l_val=qs_control%xtb_control%do_spinpol)
1634 CALL section_vals_val_get(xtb_section,
"VDW_POTENTIAL", explicit=explicit)
1636 CALL section_vals_val_get(xtb_section,
"VDW_POTENTIAL", c_val=cval)
1637 CALL uppercase(cval)
1640 qs_control%xtb_control%vdw_type = xtb_vdw_type_none
1642 qs_control%xtb_control%vdw_type = xtb_vdw_type_d3
1644 qs_control%xtb_control%vdw_type = xtb_vdw_type_d4
1649 SELECT CASE (qs_control%xtb_control%gfn_type)
1651 qs_control%xtb_control%vdw_type = xtb_vdw_type_d4
1653 qs_control%xtb_control%vdw_type = xtb_vdw_type_d3
1655 qs_control%xtb_control%vdw_type = xtb_vdw_type_d4
1656 cpabort(
"gfn2-xtb tbd")
1662 CALL section_vals_val_get(xtb_section,
"STO_NG", i_val=ngauss)
1663 qs_control%xtb_control%sto_ng = ngauss
1664 CALL section_vals_val_get(xtb_section,
"HYDROGEN_STO_NG", i_val=ngauss)
1665 qs_control%xtb_control%h_sto_ng = ngauss
1666 CALL section_vals_val_get(xtb_section,
"STO_FLEX", explicit=explicit)
1668 CALL section_vals_val_get(xtb_section,
"STO_FLEX", &
1669 l_val=qs_control%xtb_control%sto_flex)
1671 qs_control%xtb_control%sto_flex = .false.
1673 CALL section_vals_val_get(xtb_parameter,
"PARAM_FILE_PATH", &
1674 c_val=qs_control%xtb_control%parameter_file_path)
1675 CALL section_vals_val_get(xtb_parameter,
"PARAM_FILE_NAME", explicit=explicit)
1677 CALL section_vals_val_get(xtb_parameter,
"PARAM_FILE_NAME", &
1678 c_val=qs_control%xtb_control%parameter_file_name)
1680 SELECT CASE (qs_control%xtb_control%gfn_type)
1682 qs_control%xtb_control%parameter_file_name =
"xTB0_parameters"
1684 qs_control%xtb_control%parameter_file_name =
"xTB1_parameters"
1686 cpabort(
"gfn2-xtb tbd")
1692 CALL section_vals_val_get(xtb_parameter,
"SPINPOL_PARAM_FILE_NAME", &
1693 c_val=qs_control%xtb_control%spinpol_param_file_name)
1695 CALL section_vals_val_get(xtb_parameter,
"DISPERSION_RADIUS", &
1696 r_val=qs_control%xtb_control%rcdisp)
1697 CALL section_vals_val_get(xtb_parameter,
"COORDINATION_CUTOFF", &
1698 r_val=qs_control%xtb_control%epscn)
1699 CALL section_vals_val_get(xtb_parameter,
"D3BJ_SCALING", explicit=explicit)
1701 CALL section_vals_val_get(xtb_parameter,
"D3BJ_SCALING", r_vals=scal)
1702 qs_control%xtb_control%s6 = scal(1)
1703 qs_control%xtb_control%s8 = scal(2)
1705 SELECT CASE (qs_control%xtb_control%gfn_type)
1707 qs_control%xtb_control%s6 = 1.00_dp
1708 qs_control%xtb_control%s8 = 2.85_dp
1710 qs_control%xtb_control%s6 = 1.00_dp
1711 qs_control%xtb_control%s8 = 2.40_dp
1713 cpabort(
"gfn2-xtb tbd")
1718 CALL section_vals_val_get(xtb_parameter,
"D3BJ_PARAM", explicit=explicit)
1720 CALL section_vals_val_get(xtb_parameter,
"D3BJ_PARAM", r_vals=scal)
1721 qs_control%xtb_control%a1 = scal(1)
1722 qs_control%xtb_control%a2 = scal(2)
1724 SELECT CASE (qs_control%xtb_control%gfn_type)
1726 qs_control%xtb_control%a1 = 0.80_dp
1727 qs_control%xtb_control%a2 = 4.60_dp
1729 qs_control%xtb_control%a1 = 0.63_dp
1730 qs_control%xtb_control%a2 = 5.00_dp
1732 cpabort(
"gfn2-xtb tbd")
1737 CALL section_vals_val_get(xtb_parameter,
"DISPERSION_PARAMETER_FILE", &
1738 c_val=qs_control%xtb_control%dispersion_parameter_file)
1740 CALL section_vals_val_get(xtb_parameter,
"HUCKEL_CONSTANTS", explicit=explicit)
1742 CALL section_vals_val_get(xtb_parameter,
"HUCKEL_CONSTANTS", r_vals=scal)
1743 qs_control%xtb_control%ks = scal(1)
1744 qs_control%xtb_control%kp = scal(2)
1745 qs_control%xtb_control%kd = scal(3)
1746 qs_control%xtb_control%ksp = scal(4)
1747 qs_control%xtb_control%k2sh = scal(5)
1748 IF (qs_control%xtb_control%gfn_type == 0)
THEN
1750 qs_control%xtb_control%ksp = 0.5_dp*(scal(1) + scal(2))
1753 SELECT CASE (qs_control%xtb_control%gfn_type)
1755 qs_control%xtb_control%ks = 2.00_dp
1756 qs_control%xtb_control%kp = 2.4868_dp
1757 qs_control%xtb_control%kd = 2.27_dp
1758 qs_control%xtb_control%ksp = 2.2434_dp
1759 qs_control%xtb_control%k2sh = 1.1241_dp
1761 qs_control%xtb_control%ks = 1.85_dp
1762 qs_control%xtb_control%kp = 2.25_dp
1763 qs_control%xtb_control%kd = 2.00_dp
1764 qs_control%xtb_control%ksp = 2.08_dp
1765 qs_control%xtb_control%k2sh = 2.85_dp
1767 cpabort(
"gfn2-xtb tbd")
1772 CALL section_vals_val_get(xtb_parameter,
"COULOMB_CONSTANTS", explicit=explicit)
1774 CALL section_vals_val_get(xtb_parameter,
"COULOMB_CONSTANTS", r_vals=scal)
1775 qs_control%xtb_control%kg = scal(1)
1776 qs_control%xtb_control%kf = scal(2)
1778 SELECT CASE (qs_control%xtb_control%gfn_type)
1780 qs_control%xtb_control%kg = 2.00_dp
1781 qs_control%xtb_control%kf = 1.50_dp
1783 qs_control%xtb_control%kg = 2.00_dp
1784 qs_control%xtb_control%kf = 1.50_dp
1786 cpabort(
"gfn2-xtb tbd")
1791 CALL section_vals_val_get(xtb_parameter,
"CN_CONSTANTS", r_vals=scal)
1792 qs_control%xtb_control%kcns = scal(1)
1793 qs_control%xtb_control%kcnp = scal(2)
1794 qs_control%xtb_control%kcnd = scal(3)
1796 CALL section_vals_val_get(xtb_parameter,
"EN_CONSTANTS", explicit=explicit)
1798 CALL section_vals_val_get(xtb_parameter,
"EN_CONSTANTS", r_vals=scal)
1799 SELECT CASE (qs_control%xtb_control%gfn_type)
1801 qs_control%xtb_control%ksen = scal(1)
1802 qs_control%xtb_control%kpen = scal(2)
1803 qs_control%xtb_control%kden = scal(3)
1805 qs_control%xtb_control%ken = scal(1)
1807 cpabort(
"gfn2-xtb tbd")
1812 SELECT CASE (qs_control%xtb_control%gfn_type)
1814 qs_control%xtb_control%ksen = 0.006_dp
1815 qs_control%xtb_control%kpen = -0.001_dp
1816 qs_control%xtb_control%kden = -0.002_dp
1818 qs_control%xtb_control%ken = -0.007_dp
1820 cpabort(
"gfn2-xtb tbd")
1826 CALL section_vals_val_get(xtb_parameter,
"BEN_CONSTANT", r_vals=scal)
1827 qs_control%xtb_control%ben = scal(1)
1829 CALL section_vals_val_get(xtb_parameter,
"ENSCALE", explicit=explicit)
1831 CALL section_vals_val_get(xtb_parameter,
"ENSCALE", &
1832 r_val=qs_control%xtb_control%enscale)
1834 SELECT CASE (qs_control%xtb_control%gfn_type)
1836 qs_control%xtb_control%enscale = -0.09_dp
1838 qs_control%xtb_control%enscale = 0._dp
1840 cpabort(
"gfn2-xtb tbd")
1846 CALL section_vals_val_get(xtb_section,
"USE_HALOGEN_CORRECTION", &
1847 l_val=qs_control%xtb_control%xb_interaction)
1848 CALL section_vals_val_get(xtb_parameter,
"HALOGEN_BINDING", r_vals=scal)
1849 qs_control%xtb_control%kxr = scal(1)
1850 qs_control%xtb_control%kx2 = scal(2)
1852 CALL section_vals_val_get(xtb_section,
"DO_NONBONDED", &
1853 l_val=qs_control%xtb_control%do_nonbonded)
1854 CALL section_vals_get(nonbonded_section, explicit=explicit)
1855 IF (explicit .AND. qs_control%xtb_control%do_nonbonded)
THEN
1856 CALL section_vals_get(genpot_section, explicit=explicit, n_repetition=ngp)
1858 CALL pair_potential_reallocate(qs_control%xtb_control%nonbonded, 1, ngp, gp=.true.)
1859 CALL read_gp_section(qs_control%xtb_control%nonbonded, genpot_section, 0)
1862 CALL section_vals_val_get(xtb_section,
"EPS_PAIRPOTENTIAL", &
1863 r_val=qs_control%xtb_control%eps_pair)
1865 CALL section_vals_val_get(xtb_parameter,
"COULOMB_SR_CUT", r_vals=scal)
1866 qs_control%xtb_control%coulomb_sr_cut = scal(1)
1867 CALL section_vals_val_get(xtb_parameter,
"COULOMB_SR_EPS", r_vals=scal)
1868 qs_control%xtb_control%coulomb_sr_eps = scal(1)
1870 CALL section_vals_val_get(xtb_parameter,
"XB_RADIUS", r_val=qs_control%xtb_control%xb_radius)
1872 CALL section_vals_val_get(xtb_parameter,
"KAB_PARAM", n_rep_val=n_rep)
1874 SELECT CASE (qs_control%xtb_control%gfn_type)
1876 qs_control%xtb_control%coulomb_interaction = .false.
1877 qs_control%xtb_control%coulomb_lr = .false.
1878 qs_control%xtb_control%tb3_interaction = .false.
1879 qs_control%xtb_control%check_atomic_charges = .false.
1880 CALL section_vals_val_get(xtb_section,
"VARIATIONAL_DIPOLE", &
1881 l_val=qs_control%xtb_control%var_dipole)
1884 CALL section_vals_val_get(xtb_section,
"COULOMB_INTERACTION", &
1885 l_val=qs_control%xtb_control%coulomb_interaction)
1886 CALL section_vals_val_get(xtb_section,
"COULOMB_LR", &
1887 l_val=qs_control%xtb_control%coulomb_lr)
1888 CALL section_vals_val_get(xtb_section,
"TB3_INTERACTION", &
1889 l_val=qs_control%xtb_control%tb3_interaction)
1891 CALL section_vals_val_get(xtb_section,
"CHECK_ATOMIC_CHARGES", &
1892 l_val=qs_control%xtb_control%check_atomic_charges)
1893 qs_control%xtb_control%var_dipole = .false.
1895 cpabort(
"gfn2-xtb tbd")
1899 qs_control%xtb_control%kab_nval = n_rep
1901 ALLOCATE (qs_control%xtb_control%kab_param(3, n_rep))
1902 ALLOCATE (qs_control%xtb_control%kab_types(2, n_rep))
1903 ALLOCATE (qs_control%xtb_control%kab_vals(n_rep))
1905 CALL section_vals_val_get(xtb_parameter,
"KAB_PARAM", i_rep_val=j, c_vals=clist)
1906 qs_control%xtb_control%kab_param(1, j) = clist(1)
1907 CALL get_ptable_info(clist(1) (1:2), &
1908 ielement=qs_control%xtb_control%kab_types(1, j))
1909 qs_control%xtb_control%kab_param(2, j) = clist(2)
1910 CALL get_ptable_info(clist(2) (1:2), &
1911 ielement=qs_control%xtb_control%kab_types(2, j))
1912 qs_control%xtb_control%kab_param(3, j) = clist(3)
1913 READ (clist(3),
'(F10.0)') qs_control%xtb_control%kab_vals(j)
1918 CALL section_vals_val_get(xtb_parameter,
"SPIN_POL_PARAM", n_rep_val=n_rep)
1920 ALLOCATE (qs_control%xtb_control%spinpol_type(n_rep))
1921 ALLOCATE (qs_control%xtb_control%spinpol_vals(6, n_rep))
1923 CALL section_vals_val_get(xtb_parameter,
"SPIN_POL_PARAM", i_rep_val=j, c_vals=clist)
1924 READ (clist(1),
'(A)') cval
1925 element_symbol = adjustl(trim(cval))
1926 CALL get_ptable_info(element_symbol, znum)
1927 qs_control%xtb_control%spinpol_type(j) = znum
1928 READ (clist(2),
'(F20.8)') qs_control%xtb_control%spinpol_vals(1, j)
1929 READ (clist(3),
'(F20.8)') qs_control%xtb_control%spinpol_vals(2, j)
1930 READ (clist(4),
'(F20.8)') qs_control%xtb_control%spinpol_vals(3, j)
1931 READ (clist(5),
'(F20.8)') qs_control%xtb_control%spinpol_vals(4, j)
1932 READ (clist(6),
'(F20.8)') qs_control%xtb_control%spinpol_vals(5, j)
1933 READ (clist(7),
'(F20.8)') qs_control%xtb_control%spinpol_vals(6, j)
1937 IF (qs_control%xtb_control%gfn_type == 0)
THEN
1938 CALL section_vals_val_get(xtb_parameter,
"SRB_PARAMETER", r_vals=scal)
1939 qs_control%xtb_control%ksrb = scal(1)
1940 qs_control%xtb_control%esrb = scal(2)
1941 qs_control%xtb_control%gscal = scal(3)
1942 qs_control%xtb_control%c1srb = scal(4)
1943 qs_control%xtb_control%c2srb = scal(5)
1944 qs_control%xtb_control%shift = scal(6)
1947 CALL section_vals_val_get(xtb_section,
"EN_SHIFT_TYPE", c_val=cval)
1948 CALL uppercase(cval)
1949 SELECT CASE (trim(cval))
1951 qs_control%xtb_control%enshift_type = 0
1953 qs_control%xtb_control%enshift_type = 1
1955 qs_control%xtb_control%enshift_type = 2
1957 cpabort(
"Unknown value for EN_SHIFT_TYPE")
1961 CALL read_eeq_param(eeq_section, qs_control%xtb_control%eeq_sparam)
1965 CALL section_vals_get(lri_optbas_section, explicit=qs_control%lri_optbas)
1968 IF (qs_control%xtb_control%do_tblite)
THEN
1969 CALL section_vals_val_get(xtb_tblite,
"METHOD", &
1970 i_val=qs_control%xtb_control%tblite_method)
1971 CALL section_vals_val_get(xtb_tblite,
"PARAM", &
1972 c_val=qs_control%xtb_control%tblite_param_file)
1973 CALL section_vals_val_get(xtb_tblite,
"ACCURACY", &
1974 r_val=qs_control%xtb_control%tblite_accuracy)
1975 IF (qs_control%xtb_control%tblite_accuracy <= 0.0_dp)
THEN
1976 cpabort(
"XTB/TBLITE/ACCURACY must be positive")
1978 IF (qs_control%xtb_control%tblite_mixer_damping <= 0.0_dp)
THEN
1979 cpabort(
"XTB/TBLITE_MIXER/DAMPING must be positive")
1981 CALL section_vals_val_get(xtb_tblite,
"REFERENCE_CLI", l_val=tblite_reference_cli)
1982 CALL section_vals_get(xtb_tblite_ref_cli, explicit=tblite_reference_cli_section)
1983 IF (tblite_reference_cli .AND. (.NOT. tblite_reference_cli_section))
THEN
1984 cpabort(
"XTB/TBLITE/REFERENCE_CLI keyword requires an XTB/TBLITE/REFERENCE_CLI section")
1986 IF (tblite_reference_cli .OR. tblite_reference_cli_section)
THEN
1987 CALL read_xtb_reference_cli_section(xtb_tblite_ref_cli, qs_control%xtb_control%reference_cli, cell)
1988 qs_control%xtb_control%reference_cli%enabled = .true.
1990 CALL cite_reference(katbashev2025)
1996 CALL timestop(handle)
2012 SUBROUTINE read_tblite_mixer_section(mixer_section, iterations, memory, solver, damping, omega0, min_weight, &
2013 max_weight, weight_factor, section_name)
2014 TYPE(section_vals_type),
POINTER :: mixer_section
2015 INTEGER,
INTENT(INOUT) :: iterations, memory, solver
2016 REAL(kind=dp),
INTENT(INOUT) :: damping, omega0, min_weight, max_weight, &
2018 CHARACTER(LEN=*),
INTENT(IN) :: section_name
2020 LOGICAL :: explicit, memory_explicit
2022 CALL section_vals_get(mixer_section, explicit=explicit)
2023 IF (.NOT. explicit)
RETURN
2025 CALL section_vals_val_get(mixer_section,
"ITERATIONS", i_val=iterations)
2026 CALL section_vals_val_get(mixer_section,
"MEMORY", explicit=memory_explicit)
2027 IF (memory_explicit)
CALL section_vals_val_get(mixer_section,
"MEMORY", i_val=memory)
2028 IF (.NOT. memory_explicit .OR. memory == tblite_mixer_memory_inherit)
THEN
2031 CALL section_vals_val_get(mixer_section,
"SOLVER", i_val=solver)
2032 CALL section_vals_val_get(mixer_section,
"DAMPING", r_val=damping)
2033 CALL section_vals_val_get(mixer_section,
"OMEGA0", r_val=omega0)
2034 CALL section_vals_val_get(mixer_section,
"MIN_WEIGHT", r_val=min_weight)
2035 CALL section_vals_val_get(mixer_section,
"MAX_WEIGHT", r_val=max_weight)
2036 CALL section_vals_val_get(mixer_section,
"WEIGHT_FACTOR", r_val=weight_factor)
2038 IF (iterations < 1) cpabort(trim(section_name)//
"/ITERATIONS must be positive")
2039 IF (memory < 1) cpabort(trim(section_name)//
"/MEMORY must be positive")
2040 SELECT CASE (solver)
2041 CASE (tblite_solver_gvd, tblite_solver_gvr)
2043 cpabort(trim(section_name)//
"/SOLVER must be GVD or GVR")
2045 IF (damping <= 0.0_dp) cpabort(trim(section_name)//
"/DAMPING must be positive")
2046 IF (omega0 <= 0.0_dp) cpabort(trim(section_name)//
"/OMEGA0 must be positive")
2047 IF (min_weight <= 0.0_dp) cpabort(trim(section_name)//
"/MIN_WEIGHT must be positive")
2048 IF (max_weight <= 0.0_dp) cpabort(trim(section_name)//
"/MAX_WEIGHT must be positive")
2049 IF (max_weight < min_weight)
THEN
2050 cpabort(trim(section_name)//
"/MAX_WEIGHT must not be smaller than MIN_WEIGHT")
2052 IF (weight_factor <= 0.0_dp) cpabort(trim(section_name)//
"/WEIGHT_FACTOR must be positive")
2054 END SUBROUTINE read_tblite_mixer_section
2062 SUBROUTINE read_xtb_reference_cli_section(ref_cli_section, ref_cli, cell)
2063 TYPE(section_vals_type),
POINTER :: ref_cli_section
2064 TYPE(xtb_reference_cli_type),
INTENT(INOUT) :: ref_cli
2065 TYPE(cell_type),
OPTIONAL,
POINTER :: cell
2067 REAL(kind=dp),
DIMENSION(:),
POINTER :: efield
2068 TYPE(section_vals_type),
POINTER :: fit_section, guess_section, &
2069 param_section, solvation_section, &
2072 CALL section_vals_val_get(ref_cli_section,
"_SECTION_PARAMETERS_", l_val=ref_cli%enabled)
2073 CALL section_vals_val_get(ref_cli_section,
"PROGRAM_NAME", c_val=ref_cli%program_name)
2074 CALL section_vals_val_get(ref_cli_section,
"GUESS", i_val=ref_cli%guess)
2075 CALL section_vals_val_get(ref_cli_section,
"WORK_DIRECTORY", c_val=ref_cli%work_directory)
2076 CALL section_vals_val_get(ref_cli_section,
"PREFIX", c_val=ref_cli%prefix)
2077 CALL section_vals_val_get(ref_cli_section,
"INPUT_FORMAT", c_val=ref_cli%input_format)
2078 CALL section_vals_val_get(ref_cli_section,
"RESTART", c_val=ref_cli%restart_file)
2079 CALL section_vals_val_get(ref_cli_section,
"GRAD", c_val=ref_cli%grad_file)
2080 CALL section_vals_val_get(ref_cli_section,
"JSON", c_val=ref_cli%json_file)
2081 CALL section_vals_val_get(ref_cli_section,
"POST_PROCESSING", c_val=ref_cli%post_processing)
2082 CALL section_vals_val_get(ref_cli_section,
"POST_PROCESSING_OUTPUT", &
2083 c_val=ref_cli%post_processing_output_file)
2084 CALL section_vals_val_get(ref_cli_section,
"EFIELD", explicit=ref_cli%efield_active)
2085 IF (ref_cli%efield_active)
THEN
2087 CALL section_vals_val_get(ref_cli_section,
"EFIELD", r_vals=efield)
2088 ref_cli%efield = efield(1:3)
2089 IF (
PRESENT(cell))
THEN
2090 IF (
ASSOCIATED(cell))
CALL cell_transform_input_cartesian(cell, ref_cli%efield)
2093 solvation_section => section_vals_get_subs_vals(ref_cli_section,
"IMPLICIT_SOLVATION")
2094 CALL section_vals_get(solvation_section, explicit=ref_cli%solvation_active)
2095 IF (ref_cli%solvation_active)
THEN
2096 CALL section_vals_val_get(solvation_section,
"MODEL", i_val=ref_cli%solvation_model)
2097 CALL section_vals_val_get(solvation_section,
"SOLVENT", c_val=ref_cli%solvation_solvent)
2098 CALL section_vals_val_get(solvation_section,
"BORN_KERNEL", i_val=ref_cli%solvation_born_kernel)
2099 CALL section_vals_val_get(solvation_section,
"SOLUTION_STATE", i_val=ref_cli%solvation_state)
2100 IF (len_trim(ref_cli%solvation_solvent) == 0)
THEN
2101 cpabort(
"REFERENCE_CLI implicit solvation needs SOLVENT")
2103 IF (ref_cli%solvation_model == tblite_cli_solvation_cpcm .AND. &
2104 ref_cli%solvation_born_kernel /= tblite_cli_born_kernel_auto)
THEN
2105 cpabort(
"BORN_KERNEL is invalid with MODEL CPCM")
2107 IF (ref_cli%solvation_state /= tblite_cli_solution_state_gsolv)
THEN
2108 SELECT CASE (ref_cli%solvation_model)
2109 CASE (tblite_cli_solvation_alpb, tblite_cli_solvation_gbsa)
2111 CASE (tblite_cli_solvation_gbe, tblite_cli_solvation_gb, tblite_cli_solvation_cpcm)
2112 cpabort(
"SOLUTION_STATE is valid only for ALPB/GBSA")
2116 CALL section_vals_val_get(ref_cli_section,
"ELECTRONIC_TEMPERATURE_GUESS", &
2117 r_val=ref_cli%electronic_temperature_guess)
2118 IF (ref_cli%electronic_temperature_guess < 0.0_dp)
THEN
2119 cpabort(
"XTB/TBLITE/REFERENCE_CLI/ELECTRONIC_TEMPERATURE_GUESS must not be negative")
2121 IF (ref_cli%electronic_temperature_guess > 0.0_dp .AND. ref_cli%guess /= tblite_guess_ceh)
THEN
2122 cpabort(
"XTB/TBLITE/REFERENCE_CLI/ELECTRONIC_TEMPERATURE_GUESS requires GUESS CEH")
2124 guess_section => section_vals_get_subs_vals(ref_cli_section,
"GUESS_CLI")
2125 CALL section_vals_get(guess_section, explicit=ref_cli%guess_cli%enabled)
2126 IF (ref_cli%guess_cli%enabled)
THEN
2127 CALL section_vals_val_get(guess_section,
"METHOD", i_val=ref_cli%guess_cli%method)
2128 CALL section_vals_val_get(guess_section,
"ELECTRONIC_TEMPERATURE_GUESS", &
2129 r_val=ref_cli%guess_cli%electronic_temperature_guess)
2130 IF (ref_cli%guess_cli%electronic_temperature_guess < 0.0_dp)
THEN
2131 cpabort(
"REFERENCE_CLI/GUESS_CLI/ELECTRONIC_TEMPERATURE_GUESS must not be negative")
2133 CALL section_vals_val_get(guess_section,
"SOLVER", i_val=ref_cli%guess_cli%solver)
2134 CALL section_vals_val_get(guess_section,
"EFIELD", explicit=ref_cli%guess_cli%efield_active)
2135 IF (ref_cli%guess_cli%efield_active)
THEN
2137 CALL section_vals_val_get(guess_section,
"EFIELD", r_vals=efield)
2138 ref_cli%guess_cli%efield = efield(1:3)
2139 IF (
PRESENT(cell))
THEN
2140 IF (
ASSOCIATED(cell))
CALL cell_transform_input_cartesian(cell, ref_cli%guess_cli%efield)
2143 CALL section_vals_val_get(guess_section,
"GRAD", l_val=ref_cli%guess_cli%grad)
2144 CALL section_vals_val_get(guess_section,
"JSON", c_val=ref_cli%guess_cli%json_file)
2145 CALL section_vals_val_get(guess_section,
"INPUT_FORMAT", c_val=ref_cli%guess_cli%input_format)
2146 CALL section_vals_val_get(guess_section,
"INPUT_FILE", c_val=ref_cli%guess_cli%input_file)
2148 param_section => section_vals_get_subs_vals(ref_cli_section,
"PARAM_CLI")
2149 CALL section_vals_get(param_section, explicit=ref_cli%param_cli%enabled)
2150 IF (ref_cli%param_cli%enabled)
THEN
2151 CALL section_vals_val_get(param_section,
"METHOD", explicit=ref_cli%param_cli%method_explicit, &
2152 i_val=ref_cli%param_cli%method)
2153 CALL section_vals_val_get(param_section,
"OUTPUT", c_val=ref_cli%param_cli%output_file)
2154 CALL section_vals_val_get(param_section,
"INPUT_FILE", c_val=ref_cli%param_cli%input_file)
2156 fit_section => section_vals_get_subs_vals(ref_cli_section,
"FIT_CLI")
2157 CALL section_vals_get(fit_section, explicit=ref_cli%fit_cli%enabled)
2158 IF (ref_cli%fit_cli%enabled)
THEN
2159 CALL section_vals_val_get(fit_section,
"PARAM_FILE", c_val=ref_cli%fit_cli%param_file)
2160 CALL section_vals_val_get(fit_section,
"INPUT_FILE", c_val=ref_cli%fit_cli%input_file)
2161 CALL section_vals_val_get(fit_section,
"DRY_RUN", l_val=ref_cli%fit_cli%dry_run)
2162 CALL section_vals_val_get(fit_section,
"COPY", c_val=ref_cli%fit_cli%copy_file)
2163 IF (len_trim(ref_cli%fit_cli%param_file) == 0)
THEN
2164 cpabort(
"XTB/TBLITE/REFERENCE_CLI/FIT_CLI needs PARAM_FILE")
2166 IF (len_trim(ref_cli%fit_cli%input_file) == 0)
THEN
2167 cpabort(
"XTB/TBLITE/REFERENCE_CLI/FIT_CLI needs INPUT_FILE")
2170 tagdiff_section => section_vals_get_subs_vals(ref_cli_section,
"TAGDIFF_CLI")
2171 CALL section_vals_get(tagdiff_section, explicit=ref_cli%tagdiff_cli%enabled)
2172 IF (ref_cli%tagdiff_cli%enabled)
THEN
2173 CALL section_vals_val_get(tagdiff_section,
"ACTUAL", c_val=ref_cli%tagdiff_cli%actual_file)
2174 CALL section_vals_val_get(tagdiff_section,
"REFERENCE", c_val=ref_cli%tagdiff_cli%reference_file)
2175 CALL section_vals_val_get(tagdiff_section,
"FIT", l_val=ref_cli%tagdiff_cli%fit)
2176 IF (len_trim(ref_cli%tagdiff_cli%actual_file) == 0)
THEN
2177 cpabort(
"XTB/TBLITE/REFERENCE_CLI/TAGDIFF_CLI needs ACTUAL")
2179 IF (len_trim(ref_cli%tagdiff_cli%reference_file) == 0)
THEN
2180 cpabort(
"XTB/TBLITE/REFERENCE_CLI/TAGDIFF_CLI needs REFERENCE")
2183 CALL section_vals_val_get(ref_cli_section,
"KEEP_FILES", l_val=ref_cli%keep_files)
2184 CALL section_vals_val_get(ref_cli_section,
"ERROR_LIMIT", r_val=ref_cli%error_limit)
2185 CALL section_vals_val_get(ref_cli_section,
"STOP_ON_ERROR", l_val=ref_cli%stop_on_error)
2186 CALL section_vals_val_get(ref_cli_section,
"CHECK_ENERGY", l_val=ref_cli%check_energy)
2187 CALL section_vals_val_get(ref_cli_section,
"CHECK_FORCES", l_val=ref_cli%check_forces)
2188 CALL section_vals_val_get(ref_cli_section,
"CHECK_VIRIAL", l_val=ref_cli%check_virial)
2190 END SUBROUTINE read_xtb_reference_cli_section
2199 TYPE(tddfpt2_control_type),
POINTER :: t_control
2200 TYPE(section_vals_type),
POINTER :: t_section
2201 TYPE(qs_control_type),
POINTER :: qs_control
2203 CHARACTER(LEN=*),
PARAMETER :: routinen =
'read_tddfpt2_control'
2205 CHARACTER(LEN=default_string_length), &
2206 DIMENSION(:),
POINTER :: tmpstringlist
2207 INTEGER :: handle, irep, isize, nrep
2208 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: inds
2209 LOGICAL :: do_ewald, do_exchange, expl, explicit, &
2211 REAL(kind=dp) :: filter, fval, hfx
2212 TYPE(section_vals_type),
POINTER :: dipole_section, mgrid_section, &
2213 soc_section, stda_section, xc_func, &
2216 CALL timeset(routinen, handle)
2218 CALL section_vals_val_get(t_section,
"_SECTION_PARAMETERS_", l_val=t_control%enabled)
2220 CALL section_vals_val_get(t_section,
"NSTATES", i_val=t_control%nstates)
2221 CALL section_vals_val_get(t_section,
"MAX_ITER", i_val=t_control%niters)
2222 CALL section_vals_val_get(t_section,
"MAX_KV", i_val=t_control%nkvs)
2223 CALL section_vals_val_get(t_section,
"NLUMO", i_val=t_control%nlumo)
2224 CALL section_vals_val_get(t_section,
"NPROC_STATE", i_val=t_control%nprocs)
2225 CALL section_vals_val_get(t_section,
"KERNEL", i_val=t_control%kernel)
2226 CALL section_vals_val_get(t_section,
"SPINFLIP", i_val=t_control%spinflip)
2227 CALL section_vals_val_get(t_section,
"OE_CORR", i_val=t_control%oe_corr)
2228 CALL section_vals_val_get(t_section,
"EV_SHIFT", r_val=t_control%ev_shift)
2229 CALL section_vals_val_get(t_section,
"EOS_SHIFT", r_val=t_control%eos_shift)
2231 CALL section_vals_val_get(t_section,
"CONVERGENCE", r_val=t_control%conv)
2232 CALL section_vals_val_get(t_section,
"MIN_AMPLITUDE", r_val=t_control%min_excitation_amplitude)
2233 CALL section_vals_val_get(t_section,
"ORTHOGONAL_EPS", r_val=t_control%orthogonal_eps)
2235 CALL section_vals_val_get(t_section,
"RESTART", l_val=t_control%is_restart)
2236 CALL section_vals_val_get(t_section,
"RKS_TRIPLETS", l_val=t_control%rks_triplets)
2237 CALL section_vals_val_get(t_section,
"DO_LRIGPW", l_val=t_control%do_lrigpw)
2238 CALL section_vals_val_get(t_section,
"DO_SMEARING", l_val=t_control%do_smearing)
2239 CALL section_vals_val_get(t_section,
"DO_BSE", l_val=t_control%do_bse)
2240 CALL section_vals_val_get(t_section,
"DO_BSE_W_ONLY", l_val=t_control%do_bse_w_only)
2241 CALL section_vals_val_get(t_section,
"DO_BSE_GW_ONLY", l_val=t_control%do_bse_gw_only)
2242 CALL section_vals_val_get(t_section,
"ADMM_KERNEL_CORRECTION_SYMMETRIC", l_val=t_control%admm_symm)
2243 CALL section_vals_val_get(t_section,
"ADMM_KERNEL_XC_CORRECTION", l_val=t_control%admm_xc_correction)
2244 CALL section_vals_val_get(t_section,
"EXCITON_DESCRIPTORS", l_val=t_control%do_exciton_descriptors)
2245 CALL section_vals_val_get(t_section,
"DIRECTIONAL_EXCITON_DESCRIPTORS", l_val=t_control%do_directional_exciton_descriptors)
2246 CALL section_vals_val_get(t_section,
"DIRECTIONAL_EXCITON_CROSSCORRELATION", &
2247 l_val=t_control%do_directional_exciton_crosscorrelation, explicit=explicit)
2248 IF (explicit .AND. t_control%do_directional_exciton_crosscorrelation .AND. &
2249 .NOT. t_control%do_directional_exciton_descriptors)
THEN
2250 CALL cp_warn(__location__, &
2251 "DIRECTIONAL_EXCITON_CROSSCORRELATION has no effect without DIRECTIONAL_EXCITON_DESCRIPTORS.")
2255 CALL section_vals_val_get(t_section,
"AUTO_BASIS", n_rep_val=nrep)
2257 CALL section_vals_val_get(t_section,
"AUTO_BASIS", i_rep_val=irep, c_vals=tmpstringlist)
2258 IF (
SIZE(tmpstringlist) == 2)
THEN
2259 CALL uppercase(tmpstringlist(2))
2260 SELECT CASE (tmpstringlist(2))
2262 SELECT CASE (tmpstringlist(1))
2266 CALL cp_abort(__location__, &
2267 "AUTO_BASIS: the size <X> is invalid for the "// &
2268 "type <"//trim(adjustl(tmpstringlist(1)))//
">; "// &
2269 "use one of SMALL, MEDIUM, LARGE, HUGE for "// &
2270 "the size. The syntax AUTO_BASIS X X is a "// &
2271 "reserved case for using NO automatically "// &
2272 "generated basis sets.")
2283 cpabort(
"Unknown basis size in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
2286 SELECT CASE (tmpstringlist(1))
2289 t_control%auto_basis_p_lri_aux = isize
2291 cpabort(
"Unknown basis type in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
2294 CALL cp_abort(__location__, &
2295 "AUTO_BASIS keyword in &PROPERTIES &TDDFT section has a wrong number of arguments.")
2299 IF (t_control%conv < 0)
THEN
2300 t_control%conv = abs(t_control%conv)
2304 dipole_section => section_vals_get_subs_vals(t_section,
"DIPOLE_MOMENTS")
2305 CALL section_vals_val_get(dipole_section,
"DIPOLE_FORM", explicit=explicit)
2307 CALL section_vals_val_get(dipole_section,
"DIPOLE_FORM", i_val=t_control%dipole_form)
2309 t_control%dipole_form = 0
2311 CALL section_vals_val_get(dipole_section,
"REFERENCE", i_val=t_control%dipole_reference)
2312 CALL section_vals_val_get(dipole_section,
"REFERENCE_POINT", explicit=explicit)
2314 CALL section_vals_val_get(dipole_section,
"REFERENCE_POINT", r_vals=t_control%dipole_ref_point)
2316 NULLIFY (t_control%dipole_ref_point)
2317 IF (t_control%dipole_form == tddfpt_dipole_length .AND. t_control%dipole_reference == use_mom_ref_user)
THEN
2318 cpabort(
"User-defined reference point should be given explicitly")
2323 soc_section => section_vals_get_subs_vals(t_section,
"SOC")
2324 CALL section_vals_get(soc_section, explicit=explicit)
2326 t_control%do_soc = .true.
2330 mgrid_section => section_vals_get_subs_vals(t_section,
"MGRID")
2331 CALL section_vals_get(mgrid_section, explicit=t_control%mgrid_is_explicit)
2333 IF (t_control%mgrid_is_explicit)
THEN
2334 CALL section_vals_val_get(mgrid_section,
"NGRIDS", i_val=t_control%mgrid_ngrids, explicit=explicit)
2335 IF (.NOT. explicit) t_control%mgrid_ngrids =
SIZE(qs_control%e_cutoff)
2337 CALL section_vals_val_get(mgrid_section,
"CUTOFF", r_val=t_control%mgrid_cutoff, explicit=explicit)
2338 IF (.NOT. explicit) t_control%mgrid_cutoff = qs_control%cutoff
2340 CALL section_vals_val_get(mgrid_section,
"PROGRESSION_FACTOR", &
2341 r_val=t_control%mgrid_progression_factor, explicit=explicit)
2343 IF (t_control%mgrid_progression_factor <= 1.0_dp)
THEN
2344 CALL cp_abort(__location__, &
2345 "Progression factor should be greater then 1.0 to ensure multi-grid ordering")
2348 t_control%mgrid_progression_factor = qs_control%progression_factor
2351 CALL section_vals_val_get(mgrid_section,
"COMMENSURATE", l_val=t_control%mgrid_commensurate_mgrids, explicit=explicit)
2352 IF (.NOT. explicit) t_control%mgrid_commensurate_mgrids = qs_control%commensurate_mgrids
2353 IF (t_control%mgrid_commensurate_mgrids)
THEN
2355 t_control%mgrid_progression_factor = 4.0_dp
2357 t_control%mgrid_progression_factor = qs_control%progression_factor
2361 CALL section_vals_val_get(mgrid_section,
"REL_CUTOFF", r_val=t_control%mgrid_relative_cutoff, explicit=explicit)
2362 IF (.NOT. explicit) t_control%mgrid_relative_cutoff = qs_control%relative_cutoff
2364 CALL section_vals_val_get(mgrid_section,
"MULTIGRID_SET", l_val=multigrid_set, explicit=explicit)
2365 IF (.NOT. explicit) multigrid_set = .false.
2366 IF (multigrid_set)
THEN
2367 CALL section_vals_val_get(mgrid_section,
"MULTIGRID_CUTOFF", r_vals=t_control%mgrid_e_cutoff)
2369 NULLIFY (t_control%mgrid_e_cutoff)
2372 CALL section_vals_val_get(mgrid_section,
"REALSPACE", l_val=t_control%mgrid_realspace_mgrids, explicit=explicit)
2373 IF (.NOT. explicit) t_control%mgrid_realspace_mgrids = qs_control%realspace_mgrids
2375 CALL section_vals_val_get(mgrid_section,
"SKIP_LOAD_BALANCE_DISTRIBUTED", &
2376 l_val=t_control%mgrid_skip_load_balance, explicit=explicit)
2377 IF (.NOT. explicit) t_control%mgrid_skip_load_balance = qs_control%skip_load_balance_distributed
2379 IF (
ASSOCIATED(t_control%mgrid_e_cutoff))
THEN
2380 IF (
SIZE(t_control%mgrid_e_cutoff) /= t_control%mgrid_ngrids)
THEN
2381 cpabort(
"Inconsistent values for number of multi-grids")
2385 t_control%mgrid_e_cutoff = -t_control%mgrid_e_cutoff
2386 ALLOCATE (inds(t_control%mgrid_ngrids))
2387 CALL sort(t_control%mgrid_e_cutoff, t_control%mgrid_ngrids, inds)
2389 t_control%mgrid_e_cutoff = -t_control%mgrid_e_cutoff
2394 xc_section => section_vals_get_subs_vals(t_section,
"XC")
2395 xc_func => section_vals_get_subs_vals(xc_section,
"XC_FUNCTIONAL")
2396 CALL section_vals_get(xc_func, explicit=explicit)
2398 CALL xc_functionals_expand(xc_func, xc_section)
2402 stda_section => section_vals_get_subs_vals(t_section,
"STDA")
2403 IF (t_control%kernel == tddfpt_kernel_stda)
THEN
2404 t_control%stda_control%hfx_fraction = 0.0_dp
2405 t_control%stda_control%do_exchange = .true.
2406 t_control%stda_control%eps_td_filter = 1.e-10_dp
2407 t_control%stda_control%mn_alpha = -99.0_dp
2408 t_control%stda_control%mn_beta = -99.0_dp
2410 SELECT CASE (qs_control%periodicity)
2412 t_control%stda_control%do_ewald = .false.
2414 t_control%stda_control%do_ewald = .true.
2416 t_control%stda_control%do_ewald = .true.
2418 t_control%stda_control%do_ewald = .true.
2420 cpabort(
"Illegal value for periodiciy")
2422 CALL section_vals_get(stda_section, explicit=explicit)
2424 CALL section_vals_val_get(stda_section,
"HFX_FRACTION", r_val=hfx, explicit=expl)
2425 IF (expl) t_control%stda_control%hfx_fraction = hfx
2426 CALL section_vals_val_get(stda_section,
"EPS_TD_FILTER", r_val=filter, explicit=expl)
2427 IF (expl) t_control%stda_control%eps_td_filter = filter
2428 CALL section_vals_val_get(stda_section,
"DO_EWALD", l_val=do_ewald, explicit=expl)
2429 IF (expl) t_control%stda_control%do_ewald = do_ewald
2430 CALL section_vals_val_get(stda_section,
"DO_EXCHANGE", l_val=do_exchange, explicit=expl)
2431 IF (expl) t_control%stda_control%do_exchange = do_exchange
2432 CALL section_vals_val_get(stda_section,
"MATAGA_NISHIMOTO_CEXP", r_val=fval)
2433 t_control%stda_control%mn_alpha = fval
2434 CALL section_vals_val_get(stda_section,
"MATAGA_NISHIMOTO_XEXP", r_val=fval)
2435 t_control%stda_control%mn_beta = fval
2437 CALL section_vals_val_get(stda_section,
"COULOMB_SR_CUT", r_val=fval)
2438 t_control%stda_control%coulomb_sr_cut = fval
2439 CALL section_vals_val_get(stda_section,
"COULOMB_SR_EPS", r_val=fval)
2440 t_control%stda_control%coulomb_sr_eps = fval
2443 CALL timestop(handle)
2452 TYPE(dft_control_type),
POINTER :: dft_control
2453 TYPE(section_vals_type),
POINTER :: dft_section
2455 CHARACTER(len=*),
PARAMETER :: routinen =
'write_dft_control'
2457 CHARACTER(LEN=20) :: tmpstr
2458 INTEGER :: handle, i, i_rep, max_mtlr_iter, n_rep, &
2460 REAL(kind=dp) :: density_cut, density_smooth_cut_range, &
2461 eps_u_j_loop, gradient_cut, tau_cut
2462 TYPE(cp_logger_type),
POINTER :: logger
2463 TYPE(enumeration_type),
POINTER :: enum
2464 TYPE(keyword_type),
POINTER :: keyword
2465 TYPE(section_type),
POINTER :: section
2466 TYPE(section_vals_type),
POINTER :: xc_section
2468 IF (dft_control%qs_control%semi_empirical)
RETURN
2469 IF (dft_control%qs_control%dftb)
RETURN
2470 IF (dft_control%qs_control%xtb)
THEN
2471 CALL write_xtb_control(dft_control%qs_control%xtb_control, dft_section)
2474 CALL timeset(routinen, handle)
2477 logger => cp_get_default_logger()
2479 output_unit = cp_print_key_unit_nr(logger, dft_section, &
2480 "PRINT%DFT_CONTROL_PARAMETERS", extension=
".Log")
2482 IF (output_unit > 0)
THEN
2484 xc_section => section_vals_get_subs_vals(dft_section,
"XC")
2486 IF (dft_control%uks)
THEN
2487 WRITE (unit=output_unit, fmt=
"(/,T2,A,T78,A)") &
2488 "DFT| Spin unrestricted (spin-polarized) Kohn-Sham calculation",
"UKS"
2489 ELSE IF (dft_control%roks)
THEN
2490 WRITE (unit=output_unit, fmt=
"(/,T2,A,T77,A)") &
2491 "DFT| Spin restricted open Kohn-Sham calculation",
"ROKS"
2493 WRITE (unit=output_unit, fmt=
"(/,T2,A,T78,A)") &
2494 "DFT| Spin restricted Kohn-Sham (RKS) calculation",
"RKS"
2497 WRITE (unit=output_unit, fmt=
"(T2,A,T76,I5)") &
2498 "DFT| Multiplicity", dft_control%multiplicity
2499 WRITE (unit=output_unit, fmt=
"(T2,A,T76,I5)") &
2500 "DFT| Number of spin states", dft_control%nspins
2502 WRITE (unit=output_unit, fmt=
"(T2,A,T76,I5)") &
2503 "DFT| Charge", dft_control%charge
2505 IF (dft_control%sic_method_id /= sic_none)
CALL cite_reference(vandevondele2005b)
2506 SELECT CASE (dft_control%sic_method_id)
2509 CASE (sic_mauri_spz)
2510 tmpstr =
"SPZ/MAURI SIC"
2512 tmpstr =
"US/MAURI SIC"
2516 tmpstr =
"Explicit Orbital SIC"
2519 cpabort(
"SIC option unknown")
2522 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2523 "DFT| Self-interaction correction (SIC)", adjustr(trim(tmpstr))
2525 IF (dft_control%sic_method_id /= sic_none)
THEN
2526 WRITE (unit=output_unit, fmt=
"(T2,A,T66,ES15.6)") &
2527 "DFT| SIC scaling parameter a", dft_control%sic_scaling_a, &
2528 "DFT| SIC scaling parameter b", dft_control%sic_scaling_b
2531 IF (dft_control%sic_method_id == sic_eo)
THEN
2532 IF (dft_control%sic_list_id == sic_list_all)
THEN
2533 WRITE (unit=output_unit, fmt=
"(T2,A,T66,A)") &
2534 "DFT| SIC orbitals",
"ALL"
2536 IF (dft_control%sic_list_id == sic_list_unpaired)
THEN
2537 WRITE (unit=output_unit, fmt=
"(T2,A,T66,A)") &
2538 "DFT| SIC orbitals",
"UNPAIRED"
2542 CALL section_vals_val_get(xc_section,
"density_cutoff", r_val=density_cut)
2543 CALL section_vals_val_get(xc_section,
"gradient_cutoff", r_val=gradient_cut)
2544 CALL section_vals_val_get(xc_section,
"tau_cutoff", r_val=tau_cut)
2545 CALL section_vals_val_get(xc_section,
"density_smooth_cutoff_range", r_val=density_smooth_cut_range)
2547 WRITE (unit=output_unit, fmt=
"(T2,A,T66,ES15.6)") &
2548 "DFT| Cutoffs: density ", density_cut, &
2549 "DFT| gradient", gradient_cut, &
2550 "DFT| tau ", tau_cut, &
2551 "DFT| cutoff_smoothing_range", density_smooth_cut_range
2552 CALL section_vals_val_get(xc_section,
"XC_GRID%XC_SMOOTH_RHO", &
2554 WRITE (output_unit,
'( A, T61, A )') &
2555 " DFT| XC density smoothing ", adjustr(tmpstr)
2556 CALL section_vals_val_get(xc_section,
"XC_GRID%XC_DERIV", &
2558 WRITE (output_unit,
'( A, T61, A )') &
2559 " DFT| XC derivatives ", adjustr(tmpstr)
2560 IF (dft_control%dft_plus_u)
THEN
2561 NULLIFY (enum, keyword, section)
2562 CALL create_dft_section(section)
2563 keyword => section_get_keyword(section,
"PLUS_U_METHOD")
2564 CALL keyword_get(keyword, enum=enum)
2565 WRITE (unit=output_unit, fmt=
"(/,T2,A,T41,A40)") &
2566 "DFT+U| Method", adjustr(trim(enum_i2c(enum, dft_control%plus_u_method_id)))
2567 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2568 "DFT+U| Check atomic kind information for details"
2569 IF (dft_control%mtlr_u_j)
THEN
2570 CALL section_vals_val_get(dft_section,
"EPS_U_J_LOOP", r_val=eps_u_j_loop)
2571 WRITE (unit=output_unit, fmt=
"(T2,A,T67,ES14.7E3)") &
2572 "MTLR U J| EPS_U_J_LOOP", eps_u_j_loop
2573 CALL section_vals_val_get(dft_section,
"MAX_MTLR_LOOP", i_val=max_mtlr_iter)
2574 WRITE (unit=output_unit, fmt=
"(T2,A,T67,I10)") &
2575 "MTLR U J| MAX_MTLR_LOOP", max_mtlr_iter
2577 CALL section_release(section)
2580 WRITE (unit=output_unit, fmt=
"(A)")
""
2581 CALL xc_write(output_unit, xc_section, dft_control%lsd)
2583 IF (dft_control%apply_period_efield)
THEN
2584 WRITE (unit=output_unit, fmt=
"(A)")
""
2585 IF (dft_control%period_efield%displacement_field)
THEN
2586 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2587 "PERIODIC_EFIELD| Use displacement field formulation"
2588 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,ES14.6)") &
2589 "PERIODIC_EFIELD| Displacement field filter: x", &
2590 dft_control%period_efield%d_filter(1), &
2591 "PERIODIC_EFIELD| y", &
2592 dft_control%period_efield%d_filter(2), &
2593 "PERIODIC_EFIELD| z", &
2594 dft_control%period_efield%d_filter(3)
2596 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,ES14.6)") &
2597 "PERIODIC_EFIELD| Polarisation vector: x", &
2598 dft_control%period_efield%polarisation(1), &
2599 "PERIODIC_EFIELD| y", &
2600 dft_control%period_efield%polarisation(2), &
2601 "PERIODIC_EFIELD| z", &
2602 dft_control%period_efield%polarisation(3)
2604 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,I14)") &
2605 "PERIODIC_EFIELD| Start Frame:", &
2606 dft_control%period_efield%start_frame, &
2607 "PERIODIC_EFIELD| End Frame:", &
2608 dft_control%period_efield%end_frame
2610 IF (
ALLOCATED(dft_control%period_efield%strength_list))
THEN
2611 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,I14)") &
2612 "PERIODIC_EFIELD| Number of Intensities:", &
2613 SIZE(dft_control%period_efield%strength_list)
2614 WRITE (unit=output_unit, fmt=
"(T2,A,I10,T66,1X,ES14.6)") &
2615 "PERIODIC_EFIELD| Intensity List [a.u.] ", &
2616 1, dft_control%period_efield%strength_list(1)
2617 DO i = 2,
SIZE(dft_control%period_efield%strength_list)
2618 WRITE (unit=output_unit, fmt=
"(T2,A,I10,T66,1X,ES14.6)") &
2619 "PERIODIC_EFIELD| ", &
2620 i, dft_control%period_efield%strength_list(i)
2623 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,ES14.6)") &
2624 "PERIODIC_EFIELD| Intensity [a.u.]:", &
2625 dft_control%period_efield%strength
2628 IF (norm2(dft_control%period_efield%polarisation) < epsilon(0.0_dp))
THEN
2629 cpabort(
"Invalid (too small) polarisation vector specified for PERIODIC_EFIELD")
2633 IF (dft_control%do_sccs)
THEN
2634 WRITE (unit=output_unit, fmt=
"(/,T2,A)") &
2635 "SCCS| Self-consistent continuum solvation model"
2636 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2637 "SCCS| Relative permittivity of the solvent (medium)", &
2638 dft_control%sccs_control%epsilon_solvent, &
2639 "SCCS| Absolute permittivity [a.u.]", &
2640 dft_control%sccs_control%epsilon_solvent/fourpi
2641 SELECT CASE (dft_control%sccs_control%method_id)
2642 CASE (sccs_andreussi)
2643 WRITE (unit=output_unit, fmt=
"(T2,A,/,(T2,A,T61,ES20.6))") &
2644 "SCCS| Dielectric function proposed by Andreussi et al.", &
2645 "SCCS| rho_max", dft_control%sccs_control%rho_max, &
2646 "SCCS| rho_min", dft_control%sccs_control%rho_min
2647 CASE (sccs_fattebert_gygi)
2648 WRITE (unit=output_unit, fmt=
"(T2,A,/,(T2,A,T61,ES20.6))") &
2649 "SCCS| Dielectric function proposed by Fattebert and Gygi", &
2650 "SCCS| beta", dft_control%sccs_control%beta, &
2651 "SCCS| rho_zero", dft_control%sccs_control%rho_zero
2652 CASE (sccs_saa_andreussi)
2653 WRITE (unit=output_unit, fmt=
"(T2,A,/,A,/,(T2,A,T61,ES20.6))") &
2654 "SCCS| Dielectric function of the solvent aware algorithm", &
2655 "SCCS| proposed by Andreussi et al.", &
2656 "SCCS| rho_max", dft_control%sccs_control%rho_max, &
2657 "SCCS| rho_min", dft_control%sccs_control%rho_min, &
2658 "SCCS| f0", dft_control%sccs_control%f0, &
2659 "SCCS| delta_eta", dft_control%sccs_control%delta_eta, &
2660 "SCCS| alpha_zeta", dft_control%sccs_control%alpha_zeta, &
2661 "SCCS| delta_zeta", dft_control%sccs_control%delta_zeta, &
2662 "SCCS| R_solv", dft_control%sccs_control%R_solv
2664 cpabort(
"Invalid SCCS model specified. Please, check your input!")
2666 SELECT CASE (dft_control%sccs_control%derivative_method)
2667 CASE (sccs_derivative_fft)
2668 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2669 "SCCS| Numerical derivative calculation", &
2671 CASE (sccs_derivative_cd3)
2672 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2673 "SCCS| Numerical derivative calculation", &
2674 adjustr(
"3-point stencil central differences")
2675 CASE (sccs_derivative_cd5)
2676 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2677 "SCCS| Numerical derivative calculation", &
2678 adjustr(
"5-point stencil central differences")
2679 CASE (sccs_derivative_cd7)
2680 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2681 "SCCS| Numerical derivative calculation", &
2682 adjustr(
"7-point stencil central differences")
2684 CALL cp_abort(__location__, &
2685 "Invalid derivative method specified for SCCS model. "// &
2686 "Please, check your input!")
2688 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2689 "SCCS| Repulsion parameter alpha [mN/m] = [dyn/cm]", &
2690 cp_unit_from_cp2k(dft_control%sccs_control%alpha_solvent,
"mN/m")
2691 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2692 "SCCS| Dispersion parameter beta [GPa]", &
2693 cp_unit_from_cp2k(dft_control%sccs_control%beta_solvent,
"GPa")
2694 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2695 "SCCS| Surface tension gamma [mN/m] = [dyn/cm]", &
2696 cp_unit_from_cp2k(dft_control%sccs_control%gamma_solvent,
"mN/m")
2697 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2698 "SCCS| Mixing parameter applied during the iteration cycle", &
2699 dft_control%sccs_control%mixing
2700 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2701 "SCCS| Tolerance for the convergence of the SCCS iteration cycle", &
2702 dft_control%sccs_control%eps_sccs
2703 WRITE (unit=output_unit, fmt=
"(T2,A,T61,I20)") &
2704 "SCCS| Maximum number of iteration steps", &
2705 dft_control%sccs_control%max_iter
2706 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2707 "SCCS| SCF convergence threshold for starting the SCCS iteration", &
2708 dft_control%sccs_control%eps_scf
2709 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2710 "SCCS| Numerical increment for the cavity surface calculation", &
2711 dft_control%sccs_control%delta_rho
2714 WRITE (unit=output_unit, fmt=
"(A)")
""
2718 IF (dft_control%hairy_probes .EQV. .true.)
THEN
2719 n_rep =
SIZE(dft_control%probe)
2720 IF (output_unit > 0)
THEN
2722 WRITE (unit=output_unit, fmt=
"(T2,A,I5)") &
2723 "HP | hair probe set", i_rep
2724 WRITE (unit=output_unit, fmt=
"(T2,A,T61,*(I5))") &
2725 "HP| atom indexes", &
2726 (dft_control%probe(i_rep)%atom_ids(i), i=1, dft_control%probe(i_rep)%natoms)
2727 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2728 "HP| potential", dft_control%probe(i_rep)%mu
2729 WRITE (unit=output_unit, fmt=
"(T2,A,T61,F20.2)") &
2730 "HP| temperature", dft_control%probe(i_rep)%T
2731 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2732 "HP| eps_hp", dft_control%probe(i_rep)%eps_hp
2737 CALL cp_print_key_finished_output(output_unit, logger, dft_section, &
2738 "PRINT%DFT_CONTROL_PARAMETERS")
2740 CALL timestop(handle)
2750 TYPE(admm_control_type),
POINTER :: admm_control
2751 TYPE(section_vals_type),
POINTER :: dft_section
2754 TYPE(cp_logger_type),
POINTER :: logger
2757 logger => cp_get_default_logger()
2759 iounit = cp_print_key_unit_nr(logger, dft_section, &
2760 "PRINT%DFT_CONTROL_PARAMETERS", extension=
".Log")
2762 IF (iounit > 0)
THEN
2764 SELECT CASE (admm_control%admm_type)
2766 WRITE (unit=iounit, fmt=
"(/,T2,A,T77,A)")
"ADMM| Specific ADMM type specified",
"NONE"
2768 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMM1"
2770 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMM2"
2772 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMMS"
2774 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMMP"
2776 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMMQ"
2778 cpabort(
"admm_type")
2781 SELECT CASE (admm_control%purification_method)
2782 CASE (do_admm_purify_none)
2783 WRITE (unit=iounit, fmt=
"(T2,A,T77,A)")
"ADMM| Density matrix purification method",
"NONE"
2784 CASE (do_admm_purify_cauchy)
2785 WRITE (unit=iounit, fmt=
"(T2,A,T75,A)")
"ADMM| Density matrix purification method",
"Cauchy"
2786 CASE (do_admm_purify_cauchy_subspace)
2787 WRITE (unit=iounit, fmt=
"(T2,A,T66,A)")
"ADMM| Density matrix purification method",
"Cauchy subspace"
2788 CASE (do_admm_purify_mo_diag)
2789 WRITE (unit=iounit, fmt=
"(T2,A,T63,A)")
"ADMM| Density matrix purification method",
"MO diagonalization"
2790 CASE (do_admm_purify_mo_no_diag)
2791 WRITE (unit=iounit, fmt=
"(T2,A,T71,A)")
"ADMM| Density matrix purification method",
"MO no diag"
2792 CASE (do_admm_purify_mcweeny)
2793 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Density matrix purification method",
"McWeeny"
2794 CASE (do_admm_purify_none_dm)
2795 WRITE (unit=iounit, fmt=
"(T2,A,T73,A)")
"ADMM| Density matrix purification method",
"NONE(DM)"
2797 cpabort(
"admm_purification_method")
2800 SELECT CASE (admm_control%method)
2801 CASE (do_admm_basis_projection)
2802 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Orbital projection on ADMM basis"
2803 CASE (do_admm_blocking_purify_full)
2804 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Blocked Fock matrix projection with full purification"
2805 CASE (do_admm_blocked_projection)
2806 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Blocked Fock matrix projection"
2807 CASE (do_admm_charge_constrained_projection)
2808 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Orbital projection with charge constrain"
2810 cpabort(
"admm method")
2813 SELECT CASE (admm_control%scaling_model)
2814 CASE (do_admm_exch_scaling_none)
2815 CASE (do_admm_exch_scaling_merlot)
2816 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Use Merlot (2014) scaling model"
2818 cpabort(
"admm scaling_model")
2821 WRITE (unit=iounit, fmt=
"(T2,A,T61,G20.10)")
"ADMM| eps_filter", admm_control%eps_filter
2823 SELECT CASE (admm_control%aux_exch_func)
2824 CASE (do_admm_aux_exch_func_none)
2825 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| No exchange functional correction term used"
2826 CASE (do_admm_aux_exch_func_default, do_admm_aux_exch_func_default_libxc)
2827 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Exchange functional in correction term",
"(W)PBEX"
2828 CASE (do_admm_aux_exch_func_pbex, do_admm_aux_exch_func_pbex_libxc)
2829 WRITE (unit=iounit, fmt=
"(T2,A,T77,A)")
"ADMM| Exchange functional in correction term",
"PBEX"
2830 CASE (do_admm_aux_exch_func_opt, do_admm_aux_exch_func_opt_libxc)
2831 WRITE (unit=iounit, fmt=
"(T2,A,T77,A)")
"ADMM| Exchange functional in correction term",
"OPTX"
2832 CASE (do_admm_aux_exch_func_bee, do_admm_aux_exch_func_bee_libxc)
2833 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Exchange functional in correction term",
"Becke88"
2834 CASE (do_admm_aux_exch_func_sx_libxc)
2835 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Exchange functional in correction term",
"SlaterX"
2837 cpabort(
"admm aux_exch_func")
2840 WRITE (unit=iounit, fmt=
"(A)")
""
2844 CALL cp_print_key_finished_output(iounit, logger, dft_section, &
2845 "PRINT%DFT_CONTROL_PARAMETERS")
2853 SUBROUTINE write_xtb_control(xtb_control, dft_section)
2854 TYPE(xtb_control_type),
POINTER :: xtb_control
2855 TYPE(section_vals_type),
POINTER :: dft_section
2857 CHARACTER(len=*),
PARAMETER :: routinen =
'write_xtb_control'
2859 CHARACTER(LEN=16) :: scc_mixer_name, solver_name
2860 INTEGER :: handle, output_unit
2861 TYPE(cp_logger_type),
POINTER :: logger
2863 CALL timeset(routinen, handle)
2865 logger => cp_get_default_logger()
2867 output_unit = cp_print_key_unit_nr(logger, dft_section, &
2868 "PRINT%DFT_CONTROL_PARAMETERS", extension=
".Log")
2870 IF (output_unit > 0)
THEN
2872 WRITE (unit=output_unit, fmt=
"(/,T2,A,T31,A50)") &
2873 "xTB| Parameter file", adjustr(trim(xtb_control%parameter_file_name))
2874 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2875 "xTB| Basis expansion STO-NG", xtb_control%sto_ng
2876 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2877 "xTB| Basis expansion STO-NG for Hydrogen", xtb_control%h_sto_ng
2878 WRITE (unit=output_unit, fmt=
"(T2,A,T71,E10.4)") &
2879 "xTB| Repulsive pair potential accuracy", xtb_control%eps_pair
2880 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.6)") &
2881 "xTB| Repulsive enhancement factor", xtb_control%enscale
2882 WRITE (unit=output_unit, fmt=
"(T2,A,T71,L10)") &
2883 "xTB| Halogen interaction potential", xtb_control%xb_interaction
2884 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2885 "xTB| Halogen interaction potential cutoff radius", xtb_control%xb_radius
2886 WRITE (unit=output_unit, fmt=
"(T2,A,T71,L10)") &
2887 "xTB| Nonbonded interactions", xtb_control%do_nonbonded
2888 SELECT CASE (xtb_control%vdw_type)
2889 CASE (xtb_vdw_type_none)
2890 WRITE (unit=output_unit, fmt=
"(T2,A)")
"xTB| No vdW potential selected"
2891 CASE (xtb_vdw_type_d3)
2892 WRITE (unit=output_unit, fmt=
"(T2,A,T72,A)")
"xTB| vdW potential type:",
"DFTD3(BJ)"
2893 WRITE (unit=output_unit, fmt=
"(T2,A,T31,A50)") &
2894 "xTB| D3 Dispersion: Parameter file", adjustr(trim(xtb_control%dispersion_parameter_file))
2895 CASE (xtb_vdw_type_d4)
2896 WRITE (unit=output_unit, fmt=
"(T2,A,T76,A)")
"xTB| vdW potential type:",
"DFTD4"
2897 WRITE (unit=output_unit, fmt=
"(T2,A,T31,A50)") &
2898 "xTB| D4 Dispersion: Parameter file", adjustr(trim(xtb_control%dispersion_parameter_file))
2902 WRITE (unit=output_unit, fmt=
"(T2,A,T51,3F10.3)") &
2903 "xTB| Huckel constants ks kp kd", xtb_control%ks, xtb_control%kp, xtb_control%kd
2904 WRITE (unit=output_unit, fmt=
"(T2,A,T61,2F10.3)") &
2905 "xTB| Huckel constants ksp k2sh", xtb_control%ksp, xtb_control%k2sh
2906 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2907 "xTB| Mataga-Nishimoto exponent", xtb_control%kg
2908 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2909 "xTB| Repulsion potential exponent", xtb_control%kf
2910 WRITE (unit=output_unit, fmt=
"(T2,A,T51,3F10.3)") &
2911 "xTB| Coordination number scaling kcn(s) kcn(p) kcn(d)", &
2912 xtb_control%kcns, xtb_control%kcnp, xtb_control%kcnd
2913 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2914 "xTB| Electronegativity scaling", xtb_control%ken
2915 WRITE (unit=output_unit, fmt=
"(T2,A,T61,2F10.3)") &
2916 "xTB| Halogen potential scaling kxr kx2", xtb_control%kxr, xtb_control%kx2
2917 SELECT CASE (xtb_control%tblite_scc_mixer)
2918 CASE (tblite_scc_mixer_auto)
2919 scc_mixer_name =
"AUTO"
2920 CASE (tblite_scc_mixer_tblite)
2921 scc_mixer_name =
"TBLITE"
2922 CASE (tblite_scc_mixer_cp2k)
2923 scc_mixer_name =
"CP2K"
2924 CASE (tblite_scc_mixer_none)
2925 scc_mixer_name =
"NONE"
2927 cpabort(
"Unknown tblite SCC mixer")
2929 SELECT CASE (xtb_control%tblite_mixer_solver)
2930 CASE (tblite_solver_gvd)
2932 CASE (tblite_solver_gvr)
2935 cpabort(
"Unknown tblite SCC mixer solver")
2937 WRITE (unit=output_unit, fmt=
"(T2,A,T72,A)") &
2938 "xTB| SCC mixer:", trim(scc_mixer_name)
2939 WRITE (unit=output_unit, fmt=
"(T2,A,T71,ES10.3)") &
2940 "xTB| tblite accuracy:", xtb_control%tblite_accuracy
2941 IF (len_trim(xtb_control%tblite_param_file) > 0)
THEN
2942 WRITE (unit=output_unit, fmt=
"(T2,A,T33,A)") &
2943 "xTB| tblite parameter file:", trim(xtb_control%tblite_param_file)
2945 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2946 "xTB| tblite SCC mixer damping:", xtb_control%tblite_mixer_damping
2947 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2948 "xTB| tblite SCC mixer iterations:", xtb_control%tblite_mixer_iterations
2949 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2950 "xTB| tblite SCC mixer memory:", xtb_control%tblite_mixer_memory
2951 WRITE (unit=output_unit, fmt=
"(T2,A,T72,A)") &
2952 "xTB| tblite SCC mixer solver:", trim(solver_name)
2953 WRITE (unit=output_unit, fmt=
"(T2,A,T71,ES10.3)") &
2954 "xTB| tblite SCC mixer omega0:", xtb_control%tblite_mixer_omega0
2955 WRITE (unit=output_unit, fmt=
"(T2,A,T71,ES10.3)") &
2956 "xTB| tblite SCC mixer min weight:", xtb_control%tblite_mixer_min_weight
2957 WRITE (unit=output_unit, fmt=
"(T2,A,T71,ES10.3)") &
2958 "xTB| tblite SCC mixer max weight:", xtb_control%tblite_mixer_max_weight
2959 WRITE (unit=output_unit, fmt=
"(T2,A,T71,ES10.3)") &
2960 "xTB| tblite SCC mixer weight factor:", xtb_control%tblite_mixer_weight_factor
2961 WRITE (unit=output_unit, fmt=
"(/)")
2965 CALL cp_print_key_finished_output(output_unit, logger, dft_section, &
2966 "PRINT%DFT_CONTROL_PARAMETERS")
2968 CALL timestop(handle)
2970 END SUBROUTINE write_xtb_control
2978 TYPE(qs_control_type),
INTENT(IN) :: qs_control
2979 TYPE(section_vals_type),
POINTER :: dft_section
2981 CHARACTER(len=*),
PARAMETER :: routinen =
'write_qs_control'
2983 CHARACTER(len=20) :: method, quadrature
2984 INTEGER :: handle, i, igrid_level, ngrid_level, &
2986 TYPE(cp_logger_type),
POINTER :: logger
2987 TYPE(ddapc_restraint_type),
POINTER :: ddapc_restraint_control
2988 TYPE(enumeration_type),
POINTER :: enum
2989 TYPE(keyword_type),
POINTER :: keyword
2990 TYPE(section_type),
POINTER :: qs_section
2991 TYPE(section_vals_type),
POINTER :: print_section_vals, qs_section_vals
2993 IF (qs_control%semi_empirical)
RETURN
2994 IF (qs_control%dftb)
RETURN
2995 IF (qs_control%xtb)
RETURN
2996 CALL timeset(routinen, handle)
2997 NULLIFY (logger, print_section_vals, qs_section, qs_section_vals)
2998 logger => cp_get_default_logger()
2999 print_section_vals => section_vals_get_subs_vals(dft_section,
"PRINT")
3000 qs_section_vals => section_vals_get_subs_vals(dft_section,
"QS")
3001 CALL section_vals_get(qs_section_vals, section=qs_section)
3003 NULLIFY (enum, keyword)
3004 keyword => section_get_keyword(qs_section,
"METHOD")
3005 CALL keyword_get(keyword, enum=enum)
3006 method = trim(enum_i2c(enum, qs_control%method_id))
3008 NULLIFY (enum, keyword)
3009 keyword => section_get_keyword(qs_section,
"QUADRATURE")
3010 CALL keyword_get(keyword, enum=enum)
3011 quadrature = trim(enum_i2c(enum, qs_control%gapw_control%quadrature))
3013 output_unit = cp_print_key_unit_nr(logger, print_section_vals, &
3014 "DFT_CONTROL_PARAMETERS", extension=
".Log")
3015 IF (output_unit > 0)
THEN
3016 ngrid_level =
SIZE(qs_control%e_cutoff)
3017 WRITE (unit=output_unit, fmt=
"(/,T2,A,T61,A20)") &
3018 "QS| Method:", adjustr(method)
3019 IF (qs_control%pw_grid_opt%spherical)
THEN
3020 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A)") &
3021 "QS| Density plane wave grid type",
" SPHERICAL HALFSPACE"
3022 ELSE IF (qs_control%pw_grid_opt%fullspace)
THEN
3023 WRITE (unit=output_unit, fmt=
"(T2,A,T57,A)") &
3024 "QS| Density plane wave grid type",
" NON-SPHERICAL FULLSPACE"
3026 WRITE (unit=output_unit, fmt=
"(T2,A,T57,A)") &
3027 "QS| Density plane wave grid type",
" NON-SPHERICAL HALFSPACE"
3029 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
3030 "QS| Number of grid levels:",
SIZE(qs_control%e_cutoff)
3031 IF (ngrid_level == 1)
THEN
3032 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
3033 "QS| Density cutoff [a.u.]:", qs_control%e_cutoff(1)
3035 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
3036 "QS| Density cutoff [a.u.]:", qs_control%cutoff
3037 IF (qs_control%commensurate_mgrids)
THEN
3038 WRITE (unit=output_unit, fmt=
"(T2,A)")
"QS| Using commensurate multigrids"
3040 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
3041 "QS| Multi grid cutoff [a.u.]: 1) grid level", qs_control%e_cutoff(1)
3042 WRITE (unit=output_unit, fmt=
"(T2,A,I3,A,T71,F10.1)") &
3043 (
"QS| ", igrid_level,
") grid level", &
3044 qs_control%e_cutoff(igrid_level), &
3045 igrid_level=2,
SIZE(qs_control%e_cutoff))
3047 IF (qs_control%pao)
THEN
3048 WRITE (unit=output_unit, fmt=
"(T2,A)")
"QS| PAO active"
3050 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
3051 "QS| Grid level progression factor:", qs_control%progression_factor
3052 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
3053 "QS| Relative density cutoff [a.u.]:", qs_control%relative_cutoff
3054 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
3055 "QS| Interaction thresholds: eps_pgf_orb:", &
3056 qs_control%eps_pgf_orb, &
3057 "QS| eps_filter_matrix:", &
3058 qs_control%eps_filter_matrix, &
3059 "QS| eps_core_charge:", &
3060 qs_control%eps_core_charge, &
3061 "QS| eps_rho_gspace:", &
3062 qs_control%eps_rho_gspace, &
3063 "QS| eps_rho_rspace:", &
3064 qs_control%eps_rho_rspace, &
3065 "QS| eps_gvg_rspace:", &
3066 qs_control%eps_gvg_rspace, &
3068 qs_control%eps_ppl, &
3071 IF (qs_control%gapw)
THEN
3072 IF (qs_control%gapw_control%accurate_xcint)
THEN
3073 WRITE (unit=output_unit, fmt=
"(T2,A,T79,I2)") &
3074 "QS| GAPW| XC integration using accurate scheme: Polynomial order (2n) =", &
3075 qs_control%gapw_control%oweights
3076 WRITE (unit=output_unit, fmt=
"(T2,A,T69,F12.6)") &
3077 "QS| GAPW| Ref. exponent =", &
3078 qs_control%gapw_control%aweights
3081 SELECT CASE (qs_control%gapw_control%basis_1c)
3083 WRITE (unit=output_unit, fmt=
"(T2,A)") &
3084 "QS| GAPW| One center basis from orbital basis primitives"
3085 CASE (gapw_1c_small)
3086 WRITE (unit=output_unit, fmt=
"(T2,A)") &
3087 "QS| GAPW| One center basis extended with primitives (small:s)"
3088 CASE (gapw_1c_medium)
3089 WRITE (unit=output_unit, fmt=
"(T2,A)") &
3090 "QS| GAPW| One center basis extended with primitives (medium:sp)"
3091 CASE (gapw_1c_large)
3092 WRITE (unit=output_unit, fmt=
"(T2,A)") &
3093 "QS| GAPW| One center basis extended with primitives (large:spd)"
3094 CASE (gapw_1c_very_large)
3095 WRITE (unit=output_unit, fmt=
"(T2,A)") &
3096 "QS| GAPW| One center basis extended with primitives (very large:spdf)"
3098 cpabort(
"basis_1c incorrect")
3100 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
3101 "QS| GAPW| eps_fit:", &
3102 qs_control%gapw_control%eps_fit, &
3103 "QS| GAPW| eps_iso:", &
3104 qs_control%gapw_control%eps_iso, &
3105 "QS| GAPW| eps_svd:", &
3106 qs_control%gapw_control%eps_svd, &
3107 "QS| GAPW| eps_cpc:", &
3108 qs_control%gapw_control%eps_cpc
3109 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
3110 "QS| GAPW| atom-r-grid: quadrature:", &
3112 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
3113 "QS| GAPW| atom-s-grid: max l :", &
3114 qs_control%gapw_control%lmax_sphere, &
3115 "QS| GAPW| max_l_rho0 :", &
3116 qs_control%gapw_control%lmax_rho0
3117 IF (qs_control%gapw_control%non_paw_atoms)
THEN
3118 WRITE (unit=output_unit, fmt=
"(T2,A)") &
3119 "QS| GAPW| At least one kind is NOT PAW, i.e. it has only soft AO "
3121 IF (qs_control%gapw_control%nopaw_as_gpw)
THEN
3122 WRITE (unit=output_unit, fmt=
"(T2,A)") &
3123 "QS| GAPW| The NOT PAW atoms are treated fully GPW"
3126 IF (qs_control%gapw_xc)
THEN
3127 SELECT CASE (qs_control%gapw_control%basis_1c)
3129 WRITE (unit=output_unit, fmt=
"(T2,A)") &
3130 "QS| GAPW_XC| One center basis from orbital basis primitives"
3131 CASE (gapw_1c_small)
3132 WRITE (unit=output_unit, fmt=
"(T2,A)") &
3133 "QS| GAPW_XC| One center basis extended with primitives (small:s)"
3134 CASE (gapw_1c_medium)
3135 WRITE (unit=output_unit, fmt=
"(T2,A)") &
3136 "QS| GAPW_XC| One center basis extended with primitives (medium:sp)"
3137 CASE (gapw_1c_large)
3138 WRITE (unit=output_unit, fmt=
"(T2,A)") &
3139 "QS| GAPW_XC| One center basis extended with primitives (large:spd)"
3140 CASE (gapw_1c_very_large)
3141 WRITE (unit=output_unit, fmt=
"(T2,A)") &
3142 "QS| GAPW_XC| One center basis extended with primitives (very large:spdf)"
3144 cpabort(
"basis_1c incorrect")
3146 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
3147 "QS| GAPW_XC| eps_fit:", &
3148 qs_control%gapw_control%eps_fit, &
3149 "QS| GAPW_XC| eps_iso:", &
3150 qs_control%gapw_control%eps_iso, &
3151 "QS| GAPW_XC| eps_svd:", &
3152 qs_control%gapw_control%eps_svd
3153 WRITE (unit=output_unit, fmt=
"(T2,A,T55,A30)") &
3154 "QS| GAPW_XC|atom-r-grid: quadrature:", &
3155 enum_i2c(enum, qs_control%gapw_control%quadrature)
3156 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
3157 "QS| GAPW_XC| atom-s-grid: max l :", &
3158 qs_control%gapw_control%lmax_sphere
3160 IF (qs_control%mulliken_restraint)
THEN
3161 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
3162 "QS| Mulliken restraint target", qs_control%mulliken_restraint_control%target
3163 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
3164 "QS| Mulliken restraint strength", qs_control%mulliken_restraint_control%strength
3165 WRITE (unit=output_unit, fmt=
"(T2,A,T73,I8)") &
3166 "QS| Mulliken restraint atoms: ", qs_control%mulliken_restraint_control%natoms
3167 WRITE (unit=output_unit, fmt=
"(5I8)") qs_control%mulliken_restraint_control%atoms
3169 IF (qs_control%ddapc_restraint)
THEN
3170 DO i = 1,
SIZE(qs_control%ddapc_restraint_control)
3171 ddapc_restraint_control => qs_control%ddapc_restraint_control(i)
3172 IF (
SIZE(qs_control%ddapc_restraint_control) > 1)
THEN
3173 WRITE (unit=output_unit, fmt=
"(T2,A,T3,I8)") &
3174 "QS| parameters for DDAPC restraint number", i
3176 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
3177 "QS| ddapc restraint target", ddapc_restraint_control%target
3178 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
3179 "QS| ddapc restraint strength", ddapc_restraint_control%strength
3180 WRITE (unit=output_unit, fmt=
"(T2,A,T73,I8)") &
3181 "QS| ddapc restraint atoms: ", ddapc_restraint_control%natoms
3182 WRITE (unit=output_unit, fmt=
"(5I8)") ddapc_restraint_control%atoms
3183 WRITE (unit=output_unit, fmt=
"(T2,A)")
"Coefficients:"
3184 WRITE (unit=output_unit, fmt=
"(5F6.2)") ddapc_restraint_control%coeff
3185 SELECT CASE (ddapc_restraint_control%functional_form)
3186 CASE (do_ddapc_restraint)
3187 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
3188 "QS| ddapc restraint functional form :",
"RESTRAINT"
3189 CASE (do_ddapc_constraint)
3190 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
3191 "QS| ddapc restraint functional form :",
"CONSTRAINT"
3193 cpabort(
"Unknown ddapc restraint")
3197 IF (qs_control%s2_restraint)
THEN
3198 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
3199 "QS| s2 restraint target", qs_control%s2_restraint_control%target
3200 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
3201 "QS| s2 restraint strength", qs_control%s2_restraint_control%strength
3202 SELECT CASE (qs_control%s2_restraint_control%functional_form)
3203 CASE (do_s2_restraint)
3204 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
3205 "QS| s2 restraint functional form :",
"RESTRAINT"
3206 cpabort(
"Not yet implemented")
3207 CASE (do_s2_constraint)
3208 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
3209 "QS| s2 restraint functional form :",
"CONSTRAINT"
3211 cpabort(
"Unknown ddapc restraint")
3215 CALL cp_print_key_finished_output(output_unit, logger, print_section_vals, &
3216 "DFT_CONTROL_PARAMETERS")
3218 CALL timestop(handle)
3235 TYPE(qs_control_type),
INTENT(INOUT) :: qs_control
3236 TYPE(section_vals_type),
OPTIONAL,
POINTER :: qs_section, ddapc_restraint_section
3238 INTEGER :: i, j, jj, k, n_rep
3239 INTEGER,
DIMENSION(:),
POINTER :: tmplist
3240 REAL(kind=dp),
DIMENSION(:),
POINTER :: rtmplist
3241 TYPE(ddapc_restraint_type),
POINTER :: ddapc_restraint_control
3242 TYPE(section_vals_type),
POINTER :: ddapc_section
3244 IF (
PRESENT(ddapc_restraint_section))
THEN
3245 IF (
ASSOCIATED(qs_control%ddapc_restraint_control))
THEN
3246 IF (
SIZE(qs_control%ddapc_restraint_control) >= 2)
THEN
3247 cpabort(
"ET_COUPLING cannot be used in combination with a normal restraint")
3250 ddapc_section => ddapc_restraint_section
3251 ALLOCATE (qs_control%ddapc_restraint_control(1))
3255 IF (
PRESENT(qs_section))
THEN
3256 NULLIFY (ddapc_section)
3257 ddapc_section => section_vals_get_subs_vals(qs_section, &
3261 DO i = 1,
SIZE(qs_control%ddapc_restraint_control)
3263 CALL ddapc_control_create(qs_control%ddapc_restraint_control(i))
3264 ddapc_restraint_control => qs_control%ddapc_restraint_control(i)
3266 CALL section_vals_val_get(ddapc_section,
"STRENGTH", i_rep_section=i, &
3267 r_val=ddapc_restraint_control%strength)
3268 CALL section_vals_val_get(ddapc_section,
"TARGET", i_rep_section=i, &
3269 r_val=ddapc_restraint_control%target)
3270 CALL section_vals_val_get(ddapc_section,
"FUNCTIONAL_FORM", i_rep_section=i, &
3271 i_val=ddapc_restraint_control%functional_form)
3272 CALL section_vals_val_get(ddapc_section,
"ATOMS", i_rep_section=i, &
3274 CALL section_vals_val_get(ddapc_section,
"TYPE_OF_DENSITY", i_rep_section=i, &
3275 i_val=ddapc_restraint_control%density_type)
3279 CALL section_vals_val_get(ddapc_section,
"ATOMS", i_rep_section=i, &
3280 i_rep_val=k, i_vals=tmplist)
3281 DO j = 1,
SIZE(tmplist)
3285 IF (jj < 1) cpabort(
"Need at least 1 atom to use ddapc constraints")
3286 ddapc_restraint_control%natoms = jj
3287 IF (
ASSOCIATED(ddapc_restraint_control%atoms))
THEN
3288 DEALLOCATE (ddapc_restraint_control%atoms)
3290 ALLOCATE (ddapc_restraint_control%atoms(ddapc_restraint_control%natoms))
3293 CALL section_vals_val_get(ddapc_section,
"ATOMS", i_rep_section=i, &
3294 i_rep_val=k, i_vals=tmplist)
3295 DO j = 1,
SIZE(tmplist)
3297 ddapc_restraint_control%atoms(jj) = tmplist(j)
3301 IF (
ASSOCIATED(ddapc_restraint_control%coeff))
THEN
3302 DEALLOCATE (ddapc_restraint_control%coeff)
3304 ALLOCATE (ddapc_restraint_control%coeff(ddapc_restraint_control%natoms))
3305 ddapc_restraint_control%coeff = 1.0_dp
3307 CALL section_vals_val_get(ddapc_section,
"COEFF", i_rep_section=i, &
3311 CALL section_vals_val_get(ddapc_section,
"COEFF", i_rep_section=i, &
3312 i_rep_val=k, r_vals=rtmplist)
3313 DO j = 1,
SIZE(rtmplist)
3315 IF (jj > ddapc_restraint_control%natoms)
THEN
3316 cpabort(
"Need the same number of coeff as there are atoms ")
3318 ddapc_restraint_control%coeff(jj) = rtmplist(j)
3321 IF (jj < ddapc_restraint_control%natoms .AND. jj /= 0)
THEN
3322 cpabort(
"Need no or the same number of coeff as there are atoms.")
3326 DO i = 1,
SIZE(qs_control%ddapc_restraint_control)
3327 IF (qs_control%ddapc_restraint_control(i)%functional_form == &
3328 do_ddapc_constraint) k = k + 1
3330 IF (k == 2)
CALL cp_abort(__location__, &
3331 "Only a single constraint possible yet, try to use restraints instead ")
3341 SUBROUTINE read_efield_sections(dft_control, efield_section, cell)
3342 TYPE(dft_control_type),
POINTER :: dft_control
3343 TYPE(section_vals_type),
POINTER :: efield_section
3344 TYPE(cell_type),
OPTIONAL,
POINTER :: cell
3346 CHARACTER(len=default_path_length) :: file_name
3347 INTEGER :: i, io, j, n, unit_nr
3348 LOGICAL :: amplitude_explicit, intensity_explicit
3349 REAL(kind=dp),
DIMENSION(:),
POINTER :: tmp_vals
3350 TYPE(efield_type),
POINTER :: efield
3351 TYPE(section_vals_type),
POINTER :: tmp_section
3353 DO i = 1,
SIZE(dft_control%efield_fields)
3354 NULLIFY (dft_control%efield_fields(i)%efield)
3355 ALLOCATE (dft_control%efield_fields(i)%efield)
3356 efield => dft_control%efield_fields(i)%efield
3357 NULLIFY (efield%envelop_i_vars, efield%envelop_r_vars)
3358 CALL section_vals_val_get(efield_section,
"INTENSITY", i_rep_section=i, &
3359 r_val=efield%strength, explicit=intensity_explicit)
3360 CALL section_vals_val_get(efield_section,
"AMPLITUDE", i_rep_section=i, &
3361 r_val=efield%amplitude, explicit=amplitude_explicit)
3363 IF (intensity_explicit .AND. amplitude_explicit)
THEN
3364 cpabort(
"Both INTENSITY and AMPLITUDE provided in EFIELD section.")
3367 IF (intensity_explicit)
THEN
3368 efield%amplitude = sqrt(efield%strength/(3.50944_dp*10.0_dp**16))
3371 IF (amplitude_explicit)
THEN
3372 efield%strength = (3.50944_dp*10.0_dp**16)*(efield%amplitude)**2
3375 CALL section_vals_val_get(efield_section,
"POLARISATION", i_rep_section=i, &
3377 ALLOCATE (efield%polarisation(
SIZE(tmp_vals)))
3378 efield%polarisation = tmp_vals
3379 IF (
PRESENT(cell))
THEN
3380 IF (
ASSOCIATED(cell))
CALL cell_transform_input_cartesian(cell, efield%polarisation(1:3))
3382 CALL section_vals_val_get(efield_section,
"PHASE", i_rep_section=i, &
3383 r_val=efield%phase_offset)
3384 CALL section_vals_val_get(efield_section,
"ENVELOP", i_rep_section=i, &
3385 i_val=efield%envelop_id)
3386 CALL section_vals_val_get(efield_section,
"WAVELENGTH", i_rep_section=i, &
3387 r_val=efield%wavelength)
3388 CALL section_vals_val_get(efield_section,
"VEC_POT_INITIAL", i_rep_section=i, &
3390 efield%vec_pot_initial = tmp_vals
3391 IF (
PRESENT(cell))
THEN
3392 IF (
ASSOCIATED(cell))
CALL cell_transform_input_cartesian(cell, efield%vec_pot_initial(1:3))
3395 IF (efield%envelop_id == constant_env)
THEN
3396 ALLOCATE (efield%envelop_i_vars(2))
3397 tmp_section => section_vals_get_subs_vals(efield_section,
"CONSTANT_ENV", i_rep_section=i)
3398 CALL section_vals_val_get(tmp_section,
"START_STEP", &
3399 i_val=efield%envelop_i_vars(1))
3400 CALL section_vals_val_get(tmp_section,
"END_STEP", &
3401 i_val=efield%envelop_i_vars(2))
3402 ELSE IF (efield%envelop_id == gaussian_env)
THEN
3403 ALLOCATE (efield%envelop_r_vars(2))
3404 tmp_section => section_vals_get_subs_vals(efield_section,
"GAUSSIAN_ENV", i_rep_section=i)
3405 CALL section_vals_val_get(tmp_section,
"T0", &
3406 r_val=efield%envelop_r_vars(1))
3407 CALL section_vals_val_get(tmp_section,
"SIGMA", &
3408 r_val=efield%envelop_r_vars(2))
3409 ELSE IF (efield%envelop_id == ramp_env)
THEN
3410 ALLOCATE (efield%envelop_i_vars(4))
3411 tmp_section => section_vals_get_subs_vals(efield_section,
"RAMP_ENV", i_rep_section=i)
3412 CALL section_vals_val_get(tmp_section,
"START_STEP_IN", &
3413 i_val=efield%envelop_i_vars(1))
3414 CALL section_vals_val_get(tmp_section,
"END_STEP_IN", &
3415 i_val=efield%envelop_i_vars(2))
3416 CALL section_vals_val_get(tmp_section,
"START_STEP_OUT", &
3417 i_val=efield%envelop_i_vars(3))
3418 CALL section_vals_val_get(tmp_section,
"END_STEP_OUT", &
3419 i_val=efield%envelop_i_vars(4))
3420 ELSE IF (efield%envelop_id == custom_env)
THEN
3421 tmp_section => section_vals_get_subs_vals(efield_section,
"CUSTOM_ENV", i_rep_section=i)
3422 CALL section_vals_val_get(tmp_section,
"EFIELD_FILE_NAME", c_val=file_name)
3423 CALL open_file(file_name=trim(file_name), file_action=
"READ", file_status=
"OLD", unit_number=unit_nr)
3427 READ (unit_nr, *, iostat=io)
3432 ALLOCATE (efield%envelop_r_vars(n + 1))
3434 CALL section_vals_val_get(tmp_section,
"TIMESTEP", r_val=efield%envelop_r_vars(1))
3437 READ (unit_nr, *) efield%envelop_r_vars(j)
3438 efield%envelop_r_vars(j) = cp_unit_to_cp2k(efield%envelop_r_vars(j),
"volt/m")
3440 CALL close_file(unit_nr)
3443 END SUBROUTINE read_efield_sections
3451 SUBROUTINE read_rtp_section(dft_control, rtp_section)
3453 TYPE(dft_control_type),
INTENT(INOUT) :: dft_control
3454 TYPE(section_vals_type),
POINTER :: rtp_section
3456 INTEGER :: i, j, n_elems
3457 INTEGER,
DIMENSION(:),
POINTER :: tmp
3458 LOGICAL :: is_present, linearize_bse_propagation, &
3459 local_moment_possible
3460 TYPE(section_vals_type),
POINTER :: proj_mo_section, subsection
3462 ALLOCATE (dft_control%rtp_control)
3463 CALL section_vals_val_get(rtp_section,
"MAX_ITER", &
3464 i_val=dft_control%rtp_control%max_iter)
3465 CALL section_vals_val_get(rtp_section,
"MAT_EXP", &
3466 i_val=dft_control%rtp_control%mat_exp)
3467 CALL section_vals_val_get(rtp_section,
"ASPC_ORDER", &
3468 i_val=dft_control%rtp_control%aspc_order)
3469 CALL section_vals_val_get(rtp_section,
"EXP_ACCURACY", &
3470 r_val=dft_control%rtp_control%eps_exp)
3471 CALL section_vals_val_get(rtp_section,
"RTBSE%_SECTION_PARAMETERS_", &
3472 i_val=dft_control%rtp_control%rtp_method)
3473 CALL section_vals_val_get(rtp_section,
"RTBSE%RTBSE_HAMILTONIAN", &
3474 i_val=dft_control%rtp_control%rtbse_ham)
3475 CALL section_vals_val_get(rtp_section,
"RTBSE%LINEARIZED_BSE_PROPAGATION", &
3476 l_val=linearize_bse_propagation)
3480 IF (linearize_bse_propagation)
THEN
3481 IF (dft_control%rtp_control%rtp_method /= rtp_method_bse)
THEN
3482 CALL cp_abort(__location__, &
3483 "LINEARIZED_BSE_PROPAGATION requires the RTBSE section opened as "// &
3484 "'&RTBSE' or '&RTBSE RTBSE', not '&RTBSE TDDFT'.")
3486 dft_control%rtp_control%rtp_method = rtp_method_bse_linearized
3489 CALL section_vals_val_get(rtp_section,
"PROPAGATOR", &
3490 i_val=dft_control%rtp_control%propagator)
3491 CALL section_vals_val_get(rtp_section,
"EPS_ITER", &
3492 r_val=dft_control%rtp_control%eps_ener)
3493 CALL section_vals_val_get(rtp_section,
"INITIAL_WFN", &
3494 i_val=dft_control%rtp_control%initial_wfn)
3495 CALL section_vals_val_get(rtp_section,
"HFX_BALANCE_IN_CORE", &
3496 l_val=dft_control%rtp_control%hfx_redistribute)
3497 CALL section_vals_val_get(rtp_section,
"APPLY_WFN_MIX_INIT_RESTART", &
3498 l_val=dft_control%rtp_control%apply_wfn_mix_init_restart)
3499 CALL section_vals_val_get(rtp_section,
"APPLY_DELTA_PULSE", &
3500 l_val=dft_control%rtp_control%apply_delta_pulse)
3501 CALL section_vals_val_get(rtp_section,
"APPLY_DELTA_PULSE_MAG", &
3502 l_val=dft_control%rtp_control%apply_delta_pulse_mag)
3503 CALL section_vals_val_get(rtp_section,
"VELOCITY_GAUGE", &
3504 l_val=dft_control%rtp_control%velocity_gauge)
3505 CALL section_vals_val_get(rtp_section,
"VG_COM_NL", &
3506 l_val=dft_control%rtp_control%nl_gauge_transform)
3507 CALL section_vals_val_get(rtp_section,
"PERIODIC", &
3508 l_val=dft_control%rtp_control%periodic)
3509 CALL section_vals_val_get(rtp_section,
"DENSITY_PROPAGATION", &
3510 l_val=dft_control%rtp_control%linear_scaling)
3511 CALL section_vals_val_get(rtp_section,
"MCWEENY_MAX_ITER", &
3512 i_val=dft_control%rtp_control%mcweeny_max_iter)
3513 CALL section_vals_val_get(rtp_section,
"ACCURACY_REFINEMENT", &
3514 i_val=dft_control%rtp_control%acc_ref)
3515 CALL section_vals_val_get(rtp_section,
"MCWEENY_EPS", &
3516 r_val=dft_control%rtp_control%mcweeny_eps)
3517 CALL section_vals_val_get(rtp_section,
"DELTA_PULSE_SCALE", &
3518 r_val=dft_control%rtp_control%delta_pulse_scale)
3519 CALL section_vals_val_get(rtp_section,
"DELTA_PULSE_DIRECTION", &
3521 dft_control%rtp_control%delta_pulse_direction = tmp
3522 CALL section_vals_val_get(rtp_section,
"SC_CHECK_START", &
3523 i_val=dft_control%rtp_control%sc_check_start)
3524 proj_mo_section => section_vals_get_subs_vals(rtp_section,
"PRINT%PROJECTION_MO")
3525 CALL section_vals_get(proj_mo_section, explicit=is_present)
3526 IF (is_present)
THEN
3527 IF (dft_control%rtp_control%linear_scaling)
THEN
3528 CALL cp_abort(__location__, &
3529 "You have defined a time dependent projection of mos, but "// &
3530 "only the density matrix is propagated (DENSITY_PROPAGATION "// &
3531 ".TRUE.). Please either use MO-based real time DFT or do not "// &
3532 "define any PRINT%PROJECTION_MO section")
3534 dft_control%rtp_control%is_proj_mo = .true.
3536 dft_control%rtp_control%is_proj_mo = .false.
3539 local_moment_possible = (dft_control%rtp_control%rtp_method == rtp_method_bse .OR. &
3540 dft_control%rtp_control%rtp_method == rtp_method_bse_linearized) .OR. &
3541 ((.NOT. dft_control%rtp_control%periodic) .AND. dft_control%rtp_control%linear_scaling)
3543 subsection => section_vals_get_subs_vals(rtp_section,
"PRINT%MOMENTS")
3544 CALL section_vals_get(subsection, explicit=is_present)
3546 dft_control%rtp_control%save_local_moments = &
3547 is_present .OR. dft_control%rtp_control%save_local_moments
3548 IF (is_present .AND. (.NOT. local_moment_possible))
THEN
3549 CALL cp_abort(__location__,
"Moments trace printing only "// &
3550 "implemented in non-periodic systems in linear scaling. "// &
3551 "Please use DFT%PRINT%MOMENTS for other printing.")
3553 CALL section_vals_val_get(rtp_section,
"PRINT%MOMENTS%REFERENCE", &
3554 i_val=dft_control%rtp_control%moment_trace_ref_type)
3555 CALL section_vals_val_get(rtp_section,
"PRINT%MOMENTS%REFERENCE_POINT", &
3556 r_vals=dft_control%rtp_control%moment_trace_user_ref_point)
3558 subsection => section_vals_get_subs_vals(rtp_section,
"PRINT%MOMENTS_FT")
3559 CALL section_vals_get(subsection, explicit=is_present)
3561 dft_control%rtp_control%save_local_moments = &
3562 is_present .OR. dft_control%rtp_control%save_local_moments
3563 IF (is_present .AND. (.NOT. local_moment_possible))
THEN
3565 CALL cp_abort(__location__,
"Moments Fourier transform printing "// &
3566 "implemented only for non-periodic systems in linear scaling.")
3569 CALL section_vals_val_get(rtp_section,
"FT%DAMPING", &
3570 r_val=dft_control%rtp_control%ft_damping)
3571 CALL section_vals_val_get(rtp_section,
"FT%START_TIME", &
3572 r_val=dft_control%rtp_control%ft_t0)
3574 subsection => section_vals_get_subs_vals(rtp_section,
"FT%PADE")
3575 CALL section_vals_val_get(subsection,
"_SECTION_PARAMETERS_", &
3576 l_val=dft_control%rtp_control%pade_requested)
3577 CALL section_vals_val_get(subsection,
"E_MIN", &
3578 r_val=dft_control%rtp_control%pade_e_min)
3579 CALL section_vals_val_get(subsection,
"E_STEP", &
3580 r_val=dft_control%rtp_control%pade_e_step)
3581 CALL section_vals_val_get(subsection,
"E_MAX", &
3582 r_val=dft_control%rtp_control%pade_e_max)
3583 CALL section_vals_val_get(subsection,
"FIT_E_MIN", &
3584 r_val=dft_control%rtp_control%pade_fit_e_min)
3585 CALL section_vals_val_get(subsection,
"FIT_E_MAX", &
3586 r_val=dft_control%rtp_control%pade_fit_e_max)
3588 IF (dft_control%rtp_control%pade_fit_e_min < 0)
THEN
3589 dft_control%rtp_control%pade_fit_e_min = dft_control%rtp_control%pade_e_min
3591 IF (dft_control%rtp_control%pade_fit_e_max < 0)
THEN
3592 dft_control%rtp_control%pade_fit_e_max = dft_control%rtp_control%pade_e_max
3595 subsection => section_vals_get_subs_vals(rtp_section,
"PRINT%POLARIZABILITY")
3596 CALL section_vals_get(subsection, explicit=is_present)
3598 dft_control%rtp_control%save_local_moments = &
3599 is_present .OR. dft_control%rtp_control%save_local_moments
3600 IF (is_present .AND. (.NOT. local_moment_possible))
THEN
3602 CALL cp_abort(__location__,
"Polarizability printing "// &
3603 "implemented only for non-periodic systems.")
3605 CALL section_vals_val_get(subsection,
"ELEMENT", explicit=is_present, n_rep_val=n_elems)
3606 NULLIFY (dft_control%rtp_control%print_pol_elements)
3607 IF (is_present)
THEN
3610 ALLOCATE (dft_control%rtp_control%print_pol_elements(n_elems, 2))
3612 CALL section_vals_val_get(subsection,
"ELEMENT", i_vals=tmp, i_rep_val=i)
3613 dft_control%rtp_control%print_pol_elements(i, :) = tmp(:)
3618 IF (dft_control%rtp_control%print_pol_elements(i, j) > 3 .OR. &
3619 dft_control%rtp_control%print_pol_elements(i, j) < 1)
THEN
3620 cpabort(
"Polarisation tensor element not 1,2 or 3 in at least one index")
3628 dft_control%rtp_control%save_local_moments = &
3629 dft_control%rtp_control%save_local_moments .OR. &
3630 ((.NOT. dft_control%rtp_control%periodic) .AND. dft_control%rtp_control%linear_scaling)
3632 END SUBROUTINE read_rtp_section
3640 SUBROUTINE guess_pol_elements(dftc, elems)
3641 TYPE(dft_control_type) :: dftc
3642 INTEGER,
DIMENSION(:, :),
POINTER :: elems
3644 INTEGER :: i, i_nonzero, n_nonzero
3645 LOGICAL :: pol_vector_known
3646 REAL(kind=dp),
DIMENSION(3) :: pol_vector
3648 pol_vector_known = .false.
3651 IF (dftc%rtp_control%apply_delta_pulse .OR. dftc%rtp_control%apply_delta_pulse_mag)
THEN
3652 pol_vector(:) = real(dftc%rtp_control%delta_pulse_direction(:), kind=dp)
3655 pol_vector(:) = dftc%efield_fields(1)%efield%polarisation(:)
3657 IF (dot_product(pol_vector, pol_vector) > 0.0_dp) pol_vector_known = .true.
3659 IF (.NOT. pol_vector_known)
THEN
3660 cpabort(
"Cannot guess polarization elements - please specify!")
3665 IF (pol_vector(i) /= 0.0_dp)
THEN
3666 n_nonzero = n_nonzero + 1
3670 IF (n_nonzero > 1)
THEN
3671 CALL cp_abort(__location__, &
3672 "More than one non-zero field elements - "// &
3673 "cannot guess polarizability elements - please specify!")
3674 ELSE IF (n_nonzero == 0)
THEN
3675 CALL cp_abort(__location__, &
3676 "No non-zero field elements - "// &
3677 "cannot guess polarizability elements - please specify!")
3681 ALLOCATE (elems(3, 2))
3684 elems(i, 2) = i_nonzero
3688 END SUBROUTINE guess_pol_elements
3695 SUBROUTINE read_admm_block_list(admm_control, dft_section)
3696 TYPE(admm_control_type),
POINTER :: admm_control
3697 TYPE(section_vals_type),
POINTER :: dft_section
3699 INTEGER :: irep, list_size, n_rep
3700 INTEGER,
DIMENSION(:),
POINTER :: tmplist
3704 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%BLOCK_LIST", &
3707 ALLOCATE (admm_control%blocks(n_rep))
3710 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%BLOCK_LIST", &
3711 i_rep_val=irep, i_vals=tmplist)
3712 list_size =
SIZE(tmplist)
3713 ALLOCATE (admm_control%blocks(irep)%list(list_size))
3714 admm_control%blocks(irep)%list(:) = tmplist(:)
3717 END SUBROUTINE read_admm_block_list
3726 SUBROUTINE read_hairy_probes_sections(dft_control, hairy_probes_section)
3727 TYPE(dft_control_type),
POINTER :: dft_control
3728 TYPE(section_vals_type),
POINTER :: hairy_probes_section
3730 INTEGER :: i, j, jj, kk, n_rep
3731 INTEGER,
DIMENSION(:),
POINTER :: tmplist
3733 DO i = 1,
SIZE(dft_control%probe)
3734 NULLIFY (dft_control%probe(i)%atom_ids)
3736 CALL section_vals_val_get(hairy_probes_section,
"ATOM_IDS", i_rep_section=i, n_rep_val=n_rep)
3739 CALL section_vals_val_get(hairy_probes_section,
"ATOM_IDS", i_rep_section=i, i_rep_val=kk, i_vals=tmplist)
3740 jj = jj +
SIZE(tmplist)
3743 dft_control%probe(i)%natoms = jj
3744 IF (dft_control%probe(i)%natoms < 1)
THEN
3745 cpabort(
"Need at least 1 atom to use hair probes formalism")
3747 ALLOCATE (dft_control%probe(i)%atom_ids(dft_control%probe(i)%natoms))
3751 CALL section_vals_val_get(hairy_probes_section,
"ATOM_IDS", i_rep_section=i, i_rep_val=kk, i_vals=tmplist)
3752 DO j = 1,
SIZE(tmplist)
3754 dft_control%probe(i)%atom_ids(jj) = tmplist(j)
3758 CALL section_vals_val_get(hairy_probes_section,
"MU", i_rep_section=i, r_val=dft_control%probe(i)%mu)
3760 CALL section_vals_val_get(hairy_probes_section,
"T", i_rep_section=i, r_val=dft_control%probe(i)%T)
3762 CALL section_vals_val_get(hairy_probes_section,
"ALPHA", i_rep_section=i, r_val=dft_control%probe(i)%alpha)
3764 CALL section_vals_val_get(hairy_probes_section,
"eps_hp", i_rep_section=i, r_val=dft_control%probe(i)%eps_hp)
3767 END SUBROUTINE read_hairy_probes_sections
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public vandevondele2005b
integer, save, public umari2002
integer, save, public katbashev2025
integer, save, public yin2017
integer, save, public stewart2007
integer, save, public stengel2009
integer, save, public vandevondele2005a
integer, save, public andreussi2019
integer, save, public grimme2017
integer, save, public lippert1999
integer, save, public dewar1977
integer, save, public elstner1998
integer, save, public vanvoorhis2015
integer, save, public repasky2002
integer, save, public hu2007
integer, save, public andreussi2012
integer, save, public rocha2006
integer, save, public lippert1997
integer, save, public chai2025a
integer, save, public fattebert2002
integer, save, public thiel1992
integer, save, public pracht2019
integer, save, public porezag1995
integer, save, public souza2002
integer, save, public schenter2008
integer, save, public krack2000
integer, save, public dewar1985
integer, save, public stewart1989
integer, save, public seifert1996
integer, save, public zhechkov2005
Handles all functions related to the CELL.
subroutine, public cell_transform_input_cartesian(cell, vector)
Transform a Cartesian real-space vector from the user input cell frame into CP2K's canonical internal...
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dft_control_create(dft_control)
allocates and perform a very basic initialization
subroutine, public fde_control_create(fde_control)
...
subroutine, public expot_control_create(expot_control)
...
subroutine, public maxwell_control_create(maxwell_control)
...
subroutine, public ddapc_control_create(ddapc_restraint_control)
create the ddapc_restraint_type
subroutine, public admm_control_create(admm_control)
...
Utilities to set up the control types.
subroutine, public write_qs_control(qs_control, dft_section)
Purpose: Write the QS control parameters to the output unit.
subroutine, public read_rixs_control(rixs_control, rixs_section, qs_control)
Reads the input and stores in the rixs_control_type.
subroutine, public read_qs_section(qs_control, qs_section, cell)
...
subroutine, public read_tddfpt2_control(t_control, t_section, qs_control)
Read TDDFPT-related input parameters.
subroutine, public read_dft_control(dft_control, dft_section, cell)
...
subroutine, public write_admm_control(admm_control, dft_section)
Write the ADMM control parameters to the output unit.
subroutine, public write_dft_control(dft_control, dft_section)
Write the DFT control parameters to the output unit.
subroutine, public read_ddapc_section(qs_control, qs_section, ddapc_restraint_section)
reads the input parameters needed for ddapc.
subroutine, public read_mgrid_section(qs_control, dft_section)
...
Utility routines to open and close files. Tracking of preconnections.
subroutine, public open_file(file_name, file_status, file_form, file_action, file_position, file_pad, unit_number, debug, skip_get_unit_number, file_access)
Opens the requested file using a free unit number.
subroutine, public close_file(unit_number, file_status, keep_preconnection)
Close an open file given by its logical unit number. Optionally, keep the file and unit preconnected.
various routines to log and control the output. The idea is that decisions about where to log should ...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
Utility routines to read data from files. Kept as close as possible to the old parser because.
subroutine, public parser_read_line(parser, nline, at_end)
Read the next line from a logical unit "unit" (I/O node only). Skip (nline-1) lines and skip also all...
Utility routines to read data from files. Kept as close as possible to the old parser because.
subroutine, public parser_reset(parser)
Resets the parser: rewinding the unit and re-initializing all parser structures.
subroutine, public parser_release(parser)
releases the parser
subroutine, public parser_create(parser, file_name, unit_nr, para_env, end_section_label, separator_chars, comment_char, continuation_char, quote_char, section_char, parse_white_lines, initial_variables, apply_preprocessing)
Start a parser run. Initial variables allow to @SET stuff before opening the file.
utils to manipulate splines on the regular grid of a pw
integer, parameter, public pw_interp
real(kind=dp) function, public cp_unit_from_cp2k(value, unit_str, defaults, power)
converts from the internal cp2k units to the given unit
real(kind=dp) function, public cp_unit_to_cp2k(value, unit_str, defaults, power)
converts to the internal cp2k units to the given unit
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 fourpi
subroutine, public pair_potential_reallocate(p, lb1_new, ub1_new, lj, lj_charmm, williams, goodwin, eam, nequip, bmhft, bmhftd, ipbv, buck4r, buckmo, gp, tersoff, siepmann, gal, gal21, tab, deepmd, ace)
Cleans the potential parameter type.
Periodic Table related data definitions.
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.
Utility subroutines for CDFT calculations.
subroutine, public read_cdft_control_section(qs_control, cdft_control_section)
reads the input parameters needed for CDFT with OT
Input control types for NEGF/SMEAGOL transport calculations.
subroutine, public read_smeagol_control(smeagol_control, smeagol_section)
Read SMEAGOL-related input parameters.
Utilities for string manipulations.
elemental subroutine, public uppercase(string)
Convert all lower case characters in a string to upper case.
All kind of helpful little routines.
Define XAS TDP control type and associated create, release, etc subroutines, as well as XAS TDP envir...
subroutine, public read_xas_tdp_control(xas_tdp_control, xas_tdp_section)
Reads the inputs and stores in xas_tdp_control_type.
Writes information on XC functionals to output.
subroutine, public xc_write(iounit, xc_section, lsd)
...
Exchange and Correlation functional calculations.
logical function, public xc_uses_norm_drho(xc_fun_section, lsd)
...
logical function, public xc_uses_kinetic_energy_density(xc_fun_section, lsd)
...
Type defining parameters related to the simulation cell.
type of a logger, at the moment it contains just a print level starting at which level it should be l...