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) :: line
128 CHARACTER(LEN=default_string_length), &
129 DIMENSION(:),
POINTER :: tmpstringlist
130 INTEGER :: admmtype, i_rep, ios, irep, isize, &
131 kg_tnadd_method, method_id, n_rep, &
132 nrep, xc_deriv_method_id
133 LOGICAL :: at_end, do_hfx, do_ot, do_rpa_admm, do_rtp, exopt1, exopt2, exopt3, explicit, &
134 is_present, l_param, local_moment_possible, native_skala_grid, not_se, was_present
135 REAL(kind=
dp) :: density_cut, gradient_cut, tau_cut
136 REAL(kind=
dp),
DIMENSION(:),
POINTER :: pol
139 TYPE(
section_vals_type),
POINTER :: hairy_probes_section, hfx_section, kg_xc_fun_section, &
140 kg_xc_section, maxwell_section, sccs_section, scf_section, tmp_section, xc_fun_section, &
141 xc_gauxc_subsection, xc_section
143 was_present = .false.
147 NULLIFY (kg_xc_fun_section, kg_xc_section, tmp_section, xc_fun_section, xc_section, xc_gauxc_subsection)
148 ALLOCATE (dft_control)
154 SELECT CASE (method_id)
162 IF (.NOT. is_present .AND. not_se)
THEN
163 cpabort(
"XC section missing.")
170 IF (density_cut <= epsilon(0.0_dp)*100.0_dp)
THEN
171 CALL cp_warn(__location__, &
172 "DENSITY_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
173 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
175 density_cut = max(epsilon(0.0_dp)*100.0_dp, density_cut)
176 IF (gradient_cut <= epsilon(0.0_dp)*100.0_dp)
THEN
177 CALL cp_warn(__location__, &
178 "GRADIENT_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
179 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
181 gradient_cut = max(epsilon(0.0_dp)*100.0_dp, gradient_cut)
182 IF (tau_cut <= epsilon(0.0_dp)*100.0_dp)
THEN
183 CALL cp_warn(__location__, &
184 "TAU_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
185 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
187 tau_cut = max(epsilon(0.0_dp)*100.0_dp, tau_cut)
194 IF (.NOT. is_present .AND. not_se)
THEN
195 cpabort(
"XC_FUNCTIONAL section missing.")
198 dft_control%use_gauxc = .false.
207 IF (dft_control%uks .OR. dft_control%roks)
THEN
208 dft_control%nspins = 2
210 dft_control%nspins = 1
213 dft_control%lsd = (dft_control%nspins > 1)
215 IF (dft_control%use_gauxc)
THEN
216 native_skala_grid = .false.
219 gauxc_model_name = adjustl(gauxc_model_name)
221 IF (native_skala_grid .OR. &
222 (trim(gauxc_model_name) /=
"" .AND. trim(gauxc_model_name) /=
"NONE"))
THEN
223 dft_control%use_kinetic_energy_density = .true.
235 dft_control%use_kinetic_energy_density = dft_control%use_kinetic_energy_density .OR. &
247 IF (dft_control%do_fde)
THEN
249 associate(fde => dft_control%fde_control)
258 CALL section_vals_val_get(tmp_section,
"MOLCAS_INPUT_TEMPLATE", c_val=fde%molcas_input_template)
267 dft_control%drho_by_collocation = (
xc_uses_norm_drho(xc_fun_section, dft_control%lsd) &
269 IF (dft_control%drho_by_collocation)
THEN
270 cpabort(
"derivatives by collocation not implemented")
277 IF (
SIZE(tmpstringlist) == 2)
THEN
279 SELECT CASE (tmpstringlist(2))
281 SELECT CASE (tmpstringlist(1))
285 CALL cp_abort(__location__, &
286 "AUTO_BASIS: the size <X> is invalid for the "// &
287 "type <"//trim(adjustl(tmpstringlist(1)))//
">; "// &
288 "use one of SMALL, MEDIUM, LARGE, HUGE for "// &
289 "the size. The syntax AUTO_BASIS X X is a "// &
290 "reserved case for using NO automatically "// &
291 "generated basis sets.")
302 cpwarn(
"Unknown basis size in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
305 SELECT CASE (tmpstringlist(1))
308 dft_control%auto_basis_ri_aux = isize
310 dft_control%auto_basis_aux_fit = isize
312 dft_control%auto_basis_lri_aux = isize
314 dft_control%auto_basis_p_lri_aux = isize
316 dft_control%auto_basis_ri_hxc = isize
318 dft_control%auto_basis_ri_xas = isize
320 dft_control%auto_basis_ri_hfx = isize
322 cpwarn(
"Unknown basis type in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
325 CALL cp_abort(__location__, &
326 "AUTO_BASIS keyword in &DFT section has a wrong number of arguments.")
337 is_present = is_present .AND. (do_hfx .OR. do_rpa_admm)
339 dft_control%do_admm = is_present
340 dft_control%do_admm_mo = .false.
341 dft_control%do_admm_dm = .false.
347 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_TYPE", i_val=admmtype)
348 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", explicit=exopt1)
349 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%METHOD", explicit=exopt2)
350 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_SCALING_MODEL", explicit=exopt3)
351 dft_control%admm_control%admm_type = admmtype
352 SELECT CASE (admmtype)
354 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", i_val=method_id)
355 dft_control%admm_control%purification_method = method_id
356 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%METHOD", i_val=method_id)
357 dft_control%admm_control%method = method_id
358 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_SCALING_MODEL", i_val=method_id)
359 dft_control%admm_control%scaling_model = method_id
364 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", i_val=method_id)
365 dft_control%admm_control%purification_method = method_id
397 CALL cp_abort(__location__, &
398 "ADMM_TYPE keyword in &AUXILIARY_DENSITY_MATRIX_METHOD section has a wrong value.")
402 r_val=dft_control%admm_control%eps_filter)
404 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_CORRECTION_FUNC", i_val=method_id)
405 dft_control%admm_control%aux_exch_func = method_id
408 dft_control%admm_control%aux_exch_func_param = .false.
409 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_A1", explicit=explicit, &
410 r_val=dft_control%admm_control%aux_x_param(1))
411 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
412 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_A2", explicit=explicit, &
413 r_val=dft_control%admm_control%aux_x_param(2))
414 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
415 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_GAMMA", explicit=explicit, &
416 r_val=dft_control%admm_control%aux_x_param(3))
417 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
419 CALL read_admm_block_list(dft_control%admm_control, dft_section)
422 SELECT CASE (admmtype)
424 IF (exopt2)
CALL cp_warn(__location__, &
425 "Value of ADMM_PURIFICATION_METHOD keyword will be overwritten with ADMM_TYPE selections.")
426 IF (exopt3)
CALL cp_warn(__location__, &
427 "Value of EXCH_SCALING_MODEL keyword will be overwritten with ADMM_TYPE selections.")
429 IF (exopt1)
CALL cp_warn(__location__, &
430 "Value of METHOD keyword will be overwritten with ADMM_TYPE selections.")
431 IF (exopt2)
CALL cp_warn(__location__, &
432 "Value of METHOD keyword will be overwritten with ADMM_TYPE selections.")
433 IF (exopt3)
CALL cp_warn(__location__, &
434 "Value of EXCH_SCALING_MODEL keyword will be overwritten with ADMM_TYPE selections.")
443 cpabort(
"ADMM: Blocking and Merlot scaling are mutually exclusive.")
448 CALL cp_abort(__location__, &
449 "ADMM: In the case of METHOD=CHARGE_CONSTRAINED_PROJECTION, "// &
450 "ADMM_PURIFICATION_METHOD=NONE has to be set.")
456 cpabort(
"ADMM: Chosen purification requires BASIS_PROJECTION")
459 IF (.NOT. do_ot) cpabort(
"ADMM: MO-based purification requires OT.")
464 dft_control%do_admm_dm = .true.
466 dft_control%do_admm_mo = .true.
474 dft_control%restricted = (dft_control%roks .AND. l_param)
478 CALL section_vals_val_get(dft_section,
"RELAX_MULTIPLICITY", r_val=dft_control%relax_multiplicity)
479 IF (dft_control%relax_multiplicity > 0.0_dp)
THEN
480 IF (.NOT. dft_control%uks)
THEN
481 CALL cp_abort(__location__,
"The option RELAX_MULTIPLICITY is only valid for "// &
482 "unrestricted Kohn-Sham (UKS) calculations")
488 CALL section_vals_get(hairy_probes_section, n_repetition=nrep, explicit=is_present)
491 dft_control%hairy_probes = .true.
492 ALLOCATE (dft_control%probe(nrep))
493 CALL read_hairy_probes_sections(dft_control, hairy_probes_section)
500 dft_control%sic_method_id =
sic_none
501 dft_control%sic_scaling_a = 1.0_dp
502 dft_control%sic_scaling_b = 1.0_dp
505 dft_control%dft_plus_u = .false.
507 dft_control%plus_u_method_id = method_id
513 explicit=dft_control%mtlr_reference_scf_explicit)
514 IF (dft_control%mtlr_reference_scf_explicit)
THEN
516 l_val=dft_control%mtlr_reference_scf)
520 dft_control%smear = .false.
523 dft_control%correct_surf_dip = .false.
524 CALL section_vals_val_get(dft_section,
"SURFACE_DIPOLE_CORRECTION", l_val=dft_control%correct_surf_dip)
526 dft_control%pos_dir_surf_dip = -1.0_dp
530 dft_control%switch_surf_dip = .false.
531 dft_control%surf_dip_correct_switch = dft_control%correct_surf_dip
533 dft_control%correct_el_density_dip = .false.
534 CALL section_vals_val_get(dft_section,
"CORE_CORR_DIP", l_val=dft_control%correct_el_density_dip)
535 IF (dft_control%correct_el_density_dip)
THEN
536 IF (dft_control%correct_surf_dip)
THEN
539 dft_control%correct_el_density_dip = .false.
540 cpwarn(
"CORE_CORR_DIP keyword is activated only if SURFACE_DIPOLE_CORRECTION is TRUE")
545 c_val=basis_set_file_name)
547 c_val=potential_file_name)
552 i_val=dft_control%sic_method_id)
554 i_val=dft_control%sic_list_id)
556 r_val=dft_control%sic_scaling_a)
558 r_val=dft_control%sic_scaling_b)
564 CALL read_rtp_section(dft_control, tmp_section)
571 IF (dft_control%do_xas_calculation)
THEN
574 l_val=dft_control%do_xas_calculation)
578 CALL section_vals_get(tmp_section, explicit=dft_control%do_xas_tdp_calculation)
579 IF (dft_control%do_xas_tdp_calculation)
THEN
582 l_val=dft_control%do_xas_tdp_calculation)
586 dft_control%apply_efield = .false.
587 dft_control%apply_efield_field = .false.
588 dft_control%apply_vector_potential = .false.
592 ALLOCATE (dft_control%efield_fields(nrep))
593 CALL read_efield_sections(dft_control, tmp_section, cell)
595 IF (.NOT. dft_control%rtp_control%velocity_gauge)
THEN
596 dft_control%apply_efield_field = .true.
598 dft_control%apply_vector_potential = .true.
600 dft_control%rtp_control%vec_pot = dft_control%efield_fields(1)%efield%vec_pot_initial
603 dft_control%apply_efield = .true.
612 local_moment_possible = (dft_control%rtp_control%rtp_method ==
rtp_method_bse .OR. &
614 ((.NOT. dft_control%rtp_control%periodic) .AND. dft_control%rtp_control%linear_scaling)
615 IF (local_moment_possible .AND. (.NOT.
ASSOCIATED(dft_control%rtp_control%print_pol_elements)))
THEN
617 CALL guess_pol_elements(dft_control, &
618 dft_control%rtp_control%print_pol_elements)
624 CALL section_vals_get(tmp_section, explicit=dft_control%apply_period_efield)
625 IF (dft_control%apply_period_efield)
THEN
626 ALLOCATE (dft_control%period_efield)
628 dft_control%period_efield%polarisation(1:3) = pol(1:3)
629 IF (
PRESENT(cell))
THEN
630 IF (
ASSOCIATED(cell))
THEN
635 dft_control%period_efield%d_filter(1:3) = pol(1:3)
636 IF (
PRESENT(cell))
THEN
640 r_val=dft_control%period_efield%strength)
641 dft_control%period_efield%displacement_field = .false.
643 l_val=dft_control%period_efield%displacement_field)
649 IF (
SIZE(pol) > 1 .OR. pol(1) /= 0.0_dp)
THEN
651 IF (dft_control%period_efield%strength /= 0.0_dp .OR. intensities_file_name /=
"")
THEN
652 CALL cp_abort(__location__,
"[PERIODIC FIELD] Only one of INTENSITY, INTENSITY_LIST "// &
653 "or INTENSITIES_FILE_NAME can be specified.")
656 ALLOCATE (dft_control%period_efield%strength_list(
SIZE(pol)))
657 dft_control%period_efield%strength_list(1:
SIZE(pol)) = pol(1:
SIZE(pol))
660 IF (intensities_file_name /=
"")
THEN
662 IF (dft_control%period_efield%strength /= 0.0_dp)
THEN
663 CALL cp_abort(__location__,
"[PERIODIC FIELD] Only one of INTENSITY, INTENSITY_LIST "// &
664 "or INTENSITIES_FILE_NAME can be specified.")
677 cpabort(
"[PERIODIC FIELD] No intensities found in INTENSITIES_FILE_NAME")
680 ALLOCATE (dft_control%period_efield%strength_list(nrep))
685 READ (parser%input_line, *) dft_control%period_efield%strength_list(irep)
692 i_val=dft_control%period_efield%start_frame)
694 i_val=dft_control%period_efield%end_frame)
696 IF (dft_control%period_efield%end_frame /= -1)
THEN
700 IF (dft_control%period_efield%start_frame > dft_control%period_efield%end_frame)
THEN
701 cpabort(
"[PERIODIC FIELD] START_FRAME > END_FRAME")
702 ELSE IF (dft_control%period_efield%start_frame < 1)
THEN
703 cpabort(
"[PERIODIC FIELD] START_FRAME < 1")
704 ELSE IF (mod(dft_control%period_efield%end_frame - &
705 dft_control%period_efield%start_frame + 1,
SIZE(pol)) /= 0)
THEN
706 CALL cp_abort(__location__, &
707 "[PERIODIC FIELD] Number of active frames must be a multiple of the number of intensities")
713 CALL cp_abort(__location__, &
714 "Periodic efield cannot be used with RTP. When restarting a "// &
715 "run with periodic efield, set RESTART_RTP under &EXT_RESTART "// &
716 "section to .FALSE. explicitly if RESTART_DEFAULT is .TRUE.")
718 IF (dft_control%period_efield%displacement_field)
THEN
728 CALL section_vals_get(tmp_section, explicit=dft_control%apply_external_potential)
729 IF (dft_control%apply_external_potential)
THEN
732 l_val=dft_control%expot_control%read_from_cube)
734 l_val=dft_control%expot_control%static)
736 r_val=dft_control%expot_control%scaling_factor)
741 dft_control%expot_control%maxwell_solver = .true.
745 r_val=dft_control%maxwell_control%real_test)
747 i_val=dft_control%maxwell_control%int_test)
749 l_val=dft_control%maxwell_control%log_test)
751 dft_control%expot_control%maxwell_solver = .false.
761 l_val=dft_control%do_sccs)
762 IF (dft_control%do_sccs)
THEN
763 ALLOCATE (dft_control%sccs_control)
765 r_val=dft_control%sccs_control%epsilon_solvent)
767 r_val=dft_control%sccs_control%alpha_solvent)
769 r_val=dft_control%sccs_control%beta_solvent)
771 r_val=dft_control%sccs_control%delta_rho)
773 i_val=dft_control%sccs_control%derivative_method)
775 i_val=dft_control%sccs_control%method_id)
777 r_val=dft_control%sccs_control%eps_sccs)
779 r_val=dft_control%sccs_control%eps_scf)
781 r_val=dft_control%sccs_control%gamma_solvent)
783 i_val=dft_control%sccs_control%max_iter)
785 r_val=dft_control%sccs_control%mixing)
787 l_val=dft_control%sccs_control%core_fill)
789 r_val=dft_control%sccs_control%core_fill_spread)
792 ALLOCATE (dft_control%sccs_control%core_fill_kind_label(n_rep))
793 ALLOCATE (dft_control%sccs_control%core_fill_kind_spread(n_rep))
796 READ (line, *, iostat=ios) dft_control%sccs_control%core_fill_kind_label(i_rep), &
797 dft_control%sccs_control%core_fill_kind_spread(i_rep)
799 CALL cp_abort(__location__, &
800 "SCCS| Invalid line in CORE_FILL_KIND (expected <kind label> <spread in bohr>): "// &
803 CALL uppercase(dft_control%sccs_control%core_fill_kind_label(i_rep))
805 SELECT CASE (dft_control%sccs_control%method_id)
809 r_val=dft_control%sccs_control%rho_max)
811 r_val=dft_control%sccs_control%rho_min)
812 IF (dft_control%sccs_control%rho_max < dft_control%sccs_control%rho_min)
THEN
813 CALL cp_abort(__location__, &
814 "The SCCS parameter RHO_MAX is smaller than RHO_MIN. "// &
815 "Please, check your input!")
821 r_val=dft_control%sccs_control%beta)
822 IF (dft_control%sccs_control%beta < 0.5_dp)
THEN
823 CALL cp_abort(__location__, &
824 "A value smaller than 0.5 for the SCCS parameter beta "// &
825 "causes numerical problems. Please, check your input!")
828 r_val=dft_control%sccs_control%rho_zero)
833 IF (.NOT. is_present)
THEN
834 CALL cp_abort(__location__, &
835 "SCCS method SAA_ANDREUSSI requires the "// &
836 "SAA_ANDREUSSI section.")
838 IF (.NOT. all(cell%perd == 1))
THEN
839 CALL cp_abort(__location__, &
840 "SCCS method SAA_ANDREUSSI is only implemented for "// &
841 "3D periodic calculations.")
844 r_val=dft_control%sccs_control%rho_max)
846 r_val=dft_control%sccs_control%rho_min)
847 IF (dft_control%sccs_control%rho_max < dft_control%sccs_control%rho_min)
THEN
848 CALL cp_abort(__location__, &
849 "The SCCS parameter RHO_MAX is smaller than RHO_MIN. "// &
850 "Please, check your input!")
853 r_val=dft_control%sccs_control%f0)
855 r_val=dft_control%sccs_control%delta_eta)
857 r_val=dft_control%sccs_control%delta_zeta)
859 r_val=dft_control%sccs_control%r_solv)
861 r_val=dft_control%sccs_control%alpha_zeta)
865 cpabort(
"Invalid SCCS model specified. Please, check your input!")
877 l_val=dft_control%do_pcc)
878 IF (dft_control%do_pcc)
THEN
879 ALLOCATE (dft_control%pcc_control)
881 r_val=dft_control%pcc_control%dist_edge)
883 r_val=dft_control%pcc_control%gau_c)
885 i_val=dft_control%pcc_control%surf_normal)
895 l_val=dft_control%do_paep)
896 IF (dft_control%do_paep)
THEN
897 ALLOCATE (dft_control%paep_control)
899 i_val=dft_control%paep_control%surf_normal)
906 CALL section_vals_get(tmp_section, explicit=dft_control%apply_external_density)
928 TYPE(rixs_control_type),
POINTER :: rixs_control
929 TYPE(section_vals_type),
POINTER :: rixs_section
930 TYPE(qs_control_type),
POINTER :: qs_control
932 TYPE(section_vals_type),
POINTER :: td_section, xas_section
934 CALL section_vals_val_get(rixs_section,
"_SECTION_PARAMETERS_", l_val=rixs_control%enabled)
936 CALL section_vals_val_get(rixs_section,
"CORE_STATES", i_val=rixs_control%core_states)
937 CALL section_vals_val_get(rixs_section,
"VALENCE_STATES", i_val=rixs_control%valence_states)
939 td_section => section_vals_get_subs_vals(rixs_section,
"TDDFPT")
942 xas_section => section_vals_get_subs_vals(rixs_section,
"XAS_TDP")
943 CALL read_xas_tdp_control(rixs_control%xas_tdp_control, xas_section)
954 TYPE(qs_control_type),
INTENT(INOUT) :: qs_control
955 TYPE(section_vals_type),
POINTER :: dft_section
957 CHARACTER(len=*),
PARAMETER :: routinen =
'read_mgrid_section'
959 INTEGER :: handle, igrid_level, interp_kind, &
961 LOGICAL :: explicit, multigrid_set
963 REAL(dp),
DIMENSION(:),
POINTER :: cutofflist
964 TYPE(section_vals_type),
POINTER :: interp_section, mgrid_section
966 CALL timeset(routinen, handle)
968 NULLIFY (interp_section, mgrid_section, cutofflist)
969 mgrid_section => section_vals_get_subs_vals(dft_section,
"MGRID")
970 interp_section => section_vals_get_subs_vals(mgrid_section,
"INTERPOLATOR")
972 CALL section_vals_val_get(mgrid_section,
"NGRIDS", i_val=ngrid_level)
973 CALL section_vals_val_get(mgrid_section,
"MULTIGRID_SET", l_val=multigrid_set)
974 CALL section_vals_val_get(mgrid_section,
"CUTOFF", r_val=cutoff)
975 CALL section_vals_val_get(mgrid_section,
"PROGRESSION_FACTOR", r_val=qs_control%progression_factor)
976 CALL section_vals_val_get(mgrid_section,
"COMMENSURATE", l_val=qs_control%commensurate_mgrids)
977 CALL section_vals_val_get(interp_section,
"KIND", i_val=interp_kind)
978 IF (interp_kind /= pw_interp) qs_control%commensurate_mgrids = .true.
979 CALL section_vals_val_get(mgrid_section,
"REALSPACE", l_val=qs_control%realspace_mgrids)
980 CALL section_vals_val_get(mgrid_section,
"REL_CUTOFF", r_val=qs_control%relative_cutoff)
981 CALL section_vals_val_get(mgrid_section,
"SKIP_LOAD_BALANCE_DISTRIBUTED", &
982 l_val=qs_control%skip_load_balance_distributed)
985 IF (qs_control%semi_empirical .OR. qs_control%dftb .OR. qs_control%xtb)
THEN
987 multigrid_set = .false.
989 CALL section_vals_val_get(mgrid_section,
"CUTOFF", explicit=explicit, r_val=cutoff)
990 IF (.NOT. explicit) cutoff = 1.0_dp
993 ALLOCATE (qs_control%e_cutoff(ngrid_level))
994 qs_control%cutoff = cutoff
996 IF (multigrid_set)
THEN
998 IF (qs_control%commensurate_mgrids)
THEN
999 cpabort(
"Do not specify cutoffs for the commensurate grids (NYI)")
1002 CALL section_vals_val_get(mgrid_section,
"MULTIGRID_CUTOFF", r_vals=cutofflist)
1003 IF (
ASSOCIATED(cutofflist))
THEN
1004 IF (
SIZE(cutofflist, 1) /= ngrid_level)
THEN
1005 cpabort(
"Number of multi-grids requested and number of cutoff values do not match")
1007 DO igrid_level = 1, ngrid_level
1008 qs_control%e_cutoff(igrid_level) = cutofflist(igrid_level)
1012 DO igrid_level = ngrid_level, 1, -1
1013 IF (qs_control%cutoff <= qs_control%e_cutoff(igrid_level))
THEN
1014 qs_control%cutoff = qs_control%e_cutoff(igrid_level)
1018 IF (igrid_level == 1)
THEN
1019 qs_control%cutoff = qs_control%e_cutoff(1)
1023 IF (qs_control%commensurate_mgrids) qs_control%progression_factor = 4.0_dp
1024 qs_control%e_cutoff(1) = qs_control%cutoff
1025 DO igrid_level = 2, ngrid_level
1026 qs_control%e_cutoff(igrid_level) = qs_control%e_cutoff(igrid_level - 1)/ &
1027 qs_control%progression_factor
1031 DO igrid_level = 2, ngrid_level
1032 IF (qs_control%e_cutoff(igrid_level) > qs_control%e_cutoff(igrid_level - 1))
THEN
1033 cpabort(
"The cutoff values for the multi-grids are not ordered from large to small")
1034 ELSE IF (qs_control%e_cutoff(igrid_level) == qs_control%e_cutoff(igrid_level - 1))
THEN
1035 cpabort(
"The same cutoff value was specified for two multi-grids")
1038 CALL timestop(handle)
1049 TYPE(qs_control_type),
INTENT(INOUT) :: qs_control
1050 TYPE(section_vals_type),
POINTER :: qs_section
1051 TYPE(cell_type),
OPTIONAL,
POINTER :: cell
1053 CHARACTER(len=*),
PARAMETER :: routinen =
'read_qs_section'
1055 CHARACTER(LEN=2) :: element_symbol
1056 CHARACTER(LEN=default_string_length) :: cval
1057 CHARACTER(LEN=default_string_length), &
1058 DIMENSION(:),
POINTER :: clist
1059 INTEGER :: handle, itmp, j, jj, k, n_rep, n_var, &
1060 ngauss, ngp, nrep, znum
1061 INTEGER,
DIMENSION(:),
POINTER :: tmplist
1062 LOGICAL :: dftb_scc_mixer_explicit, dftb_tblite_mixer_explicit, explicit, &
1064 xtb_scc_mixer_explicit, xtb_tblite_mixer_explicit
1065 REAL(dp) :: tmp, tmpsqrt, value
1066 REAL(dp),
POINTER :: scal(:)
1067 TYPE(section_vals_type),
POINTER :: cdft_control_section, ddapc_restraint_section, &
1068 dftb_parameter, dftb_section, dftb_tblite_mixer, eeq_section, genpot_section, &
1069 lri_optbas_section, mull_section, nonbonded_section, s2_restraint_section, se_section, &
1070 xtb_parameter, xtb_section, xtb_tblite, xtb_tblite_mixer, xtb_tblite_ref_cli
1072 CALL timeset(routinen, handle)
1074 was_present = .false.
1075 NULLIFY (mull_section, ddapc_restraint_section, s2_restraint_section, &
1076 se_section, dftb_section, xtb_section, dftb_parameter, xtb_parameter, lri_optbas_section, &
1077 cdft_control_section, genpot_section, eeq_section, dftb_tblite_mixer, &
1078 xtb_tblite_mixer, xtb_tblite_ref_cli)
1080 mull_section => section_vals_get_subs_vals(qs_section,
"MULLIKEN_RESTRAINT")
1081 ddapc_restraint_section => section_vals_get_subs_vals(qs_section,
"DDAPC_RESTRAINT")
1082 s2_restraint_section => section_vals_get_subs_vals(qs_section,
"S2_RESTRAINT")
1083 se_section => section_vals_get_subs_vals(qs_section,
"SE")
1084 dftb_section => section_vals_get_subs_vals(qs_section,
"DFTB")
1085 xtb_section => section_vals_get_subs_vals(qs_section,
"xTB")
1086 dftb_parameter => section_vals_get_subs_vals(dftb_section,
"PARAMETER")
1087 dftb_tblite_mixer => section_vals_get_subs_vals(dftb_section,
"TBLITE_MIXER")
1088 xtb_parameter => section_vals_get_subs_vals(xtb_section,
"PARAMETER")
1089 eeq_section => section_vals_get_subs_vals(xtb_section,
"EEQ")
1090 lri_optbas_section => section_vals_get_subs_vals(qs_section,
"OPTIMIZE_LRI_BASIS")
1091 cdft_control_section => section_vals_get_subs_vals(qs_section,
"CDFT")
1092 nonbonded_section => section_vals_get_subs_vals(xtb_section,
"NONBONDED")
1093 genpot_section => section_vals_get_subs_vals(nonbonded_section,
"GENPOT")
1094 xtb_tblite_mixer => section_vals_get_subs_vals(xtb_section,
"TBLITE_MIXER")
1095 xtb_tblite => section_vals_get_subs_vals(xtb_section,
"TBLITE")
1096 xtb_tblite_ref_cli => section_vals_get_subs_vals(xtb_tblite,
"REFERENCE_CLI")
1100 CALL section_vals_val_get(qs_section,
"EPS_DEFAULT", r_val=
value)
1101 tmpsqrt = sqrt(
value)
1104 qs_control%eps_core_charge =
value/100.0_dp
1107 qs_control%eps_pgf_orb = tmpsqrt
1108 qs_control%eps_kg_orb = qs_control%eps_pgf_orb
1110 qs_control%eps_ppnl = qs_control%eps_pgf_orb/100.0_dp
1112 qs_control%eps_ppl = 1.0e-2_dp
1114 qs_control%gapw_control%eps_cpc =
value
1116 qs_control%eps_rho_gspace =
value
1117 qs_control%eps_rho_rspace =
value
1119 qs_control%eps_gvg_rspace = tmpsqrt
1121 CALL section_vals_val_get(qs_section,
"EPS_CORE_CHARGE", n_rep_val=n_rep)
1122 IF (n_rep /= 0)
THEN
1123 CALL section_vals_val_get(qs_section,
"EPS_CORE_CHARGE", r_val=qs_control%eps_core_charge)
1125 CALL section_vals_val_get(qs_section,
"EPS_GVG_RSPACE", n_rep_val=n_rep)
1126 IF (n_rep /= 0)
THEN
1127 CALL section_vals_val_get(qs_section,
"EPS_GVG_RSPACE", r_val=qs_control%eps_gvg_rspace)
1129 CALL section_vals_val_get(qs_section,
"EPS_PGF_ORB", n_rep_val=n_rep)
1130 IF (n_rep /= 0)
THEN
1131 CALL section_vals_val_get(qs_section,
"EPS_PGF_ORB", r_val=qs_control%eps_pgf_orb)
1133 CALL section_vals_val_get(qs_section,
"EPS_KG_ORB", n_rep_val=n_rep)
1134 IF (n_rep /= 0)
THEN
1135 CALL section_vals_val_get(qs_section,
"EPS_KG_ORB", r_val=tmp)
1136 qs_control%eps_kg_orb = sqrt(tmp)
1138 CALL section_vals_val_get(qs_section,
"EPS_PPL", n_rep_val=n_rep)
1139 IF (n_rep /= 0)
THEN
1140 CALL section_vals_val_get(qs_section,
"EPS_PPL", r_val=qs_control%eps_ppl)
1142 CALL section_vals_val_get(qs_section,
"EPS_PPNL", n_rep_val=n_rep)
1143 IF (n_rep /= 0)
THEN
1144 CALL section_vals_val_get(qs_section,
"EPS_PPNL", r_val=qs_control%eps_ppnl)
1146 CALL section_vals_val_get(qs_section,
"EPS_RHO", n_rep_val=n_rep)
1147 IF (n_rep /= 0)
THEN
1148 CALL section_vals_val_get(qs_section,
"EPS_RHO", r_val=qs_control%eps_rho_gspace)
1149 qs_control%eps_rho_rspace = qs_control%eps_rho_gspace
1151 CALL section_vals_val_get(qs_section,
"EPS_RHO_RSPACE", n_rep_val=n_rep)
1152 IF (n_rep /= 0)
THEN
1153 CALL section_vals_val_get(qs_section,
"EPS_RHO_RSPACE", r_val=qs_control%eps_rho_rspace)
1155 CALL section_vals_val_get(qs_section,
"EPS_RHO_GSPACE", n_rep_val=n_rep)
1156 IF (n_rep /= 0)
THEN
1157 CALL section_vals_val_get(qs_section,
"EPS_RHO_GSPACE", r_val=qs_control%eps_rho_gspace)
1159 CALL section_vals_val_get(qs_section,
"EPS_FILTER_MATRIX", n_rep_val=n_rep)
1160 IF (n_rep /= 0)
THEN
1161 CALL section_vals_val_get(qs_section,
"EPS_FILTER_MATRIX", r_val=qs_control%eps_filter_matrix)
1163 CALL section_vals_val_get(qs_section,
"EPS_CPC", n_rep_val=n_rep)
1164 IF (n_rep /= 0)
THEN
1165 CALL section_vals_val_get(qs_section,
"EPS_CPC", r_val=qs_control%gapw_control%eps_cpc)
1168 CALL section_vals_val_get(qs_section,
"EPSFIT", r_val=qs_control%gapw_control%eps_fit)
1169 CALL section_vals_val_get(qs_section,
"EPSISO", r_val=qs_control%gapw_control%eps_iso)
1170 CALL section_vals_val_get(qs_section,
"EPSSVD", r_val=qs_control%gapw_control%eps_svd)
1171 CALL section_vals_val_get(qs_section,
"EPSRHO0", r_val=qs_control%gapw_control%eps_Vrho0)
1172 CALL section_vals_val_get(qs_section,
"ALPHA0_HARD", r_val=qs_control%gapw_control%alpha0_hard)
1173 qs_control%gapw_control%alpha0_hard_from_input = .false.
1174 IF (qs_control%gapw_control%alpha0_hard /= 0.0_dp) qs_control%gapw_control%alpha0_hard_from_input = .true.
1175 CALL section_vals_val_get(qs_section,
"FORCE_PAW", l_val=qs_control%gapw_control%force_paw)
1176 CALL section_vals_val_get(qs_section,
"MAX_RAD_LOCAL", r_val=qs_control%gapw_control%max_rad_local)
1178 CALL section_vals_val_get(qs_section,
"MIN_PAIR_LIST_RADIUS", r_val=qs_control%pairlist_radius)
1180 CALL section_vals_val_get(qs_section,
"LS_SCF", l_val=qs_control%do_ls_scf)
1181 CALL section_vals_val_get(qs_section,
"ALMO_SCF", l_val=qs_control%do_almo_scf)
1182 CALL section_vals_val_get(qs_section,
"KG_METHOD", l_val=qs_control%do_kg)
1185 CALL section_vals_val_get(qs_section,
"REF_EMBED_SUBSYS", l_val=qs_control%ref_embed_subsys)
1186 CALL section_vals_val_get(qs_section,
"CLUSTER_EMBED_SUBSYS", l_val=qs_control%cluster_embed_subsys)
1187 CALL section_vals_val_get(qs_section,
"HIGH_LEVEL_EMBED_SUBSYS", l_val=qs_control%high_level_embed_subsys)
1188 CALL section_vals_val_get(qs_section,
"DFET_EMBEDDED", l_val=qs_control%dfet_embedded)
1189 CALL section_vals_val_get(qs_section,
"DMFET_EMBEDDED", l_val=qs_control%dmfet_embedded)
1192 CALL section_vals_val_get(qs_section,
"LMAXN1", i_val=qs_control%gapw_control%lmax_sphere)
1193 CALL section_vals_val_get(qs_section,
"LMAXN0", i_val=qs_control%gapw_control%lmax_rho0)
1194 CALL section_vals_val_get(qs_section,
"LADDN0", i_val=qs_control%gapw_control%ladd_rho0)
1195 CALL section_vals_val_get(qs_section,
"QUADRATURE", i_val=qs_control%gapw_control%quadrature)
1197 CALL section_vals_val_get(qs_section,
"GAPW_1C_BASIS", i_val=qs_control%gapw_control%basis_1c)
1198 IF (qs_control%gapw_control%basis_1c /= gapw_1c_orb)
THEN
1199 qs_control%gapw_control%eps_svd = max(qs_control%gapw_control%eps_svd, 1.e-12_dp)
1202 CALL section_vals_val_get(qs_section,
"GAPW_ACCURATE_XCINT", l_val=qs_control%gapw_control%accurate_xcint)
1203 CALL section_vals_val_get(qs_section,
"ALPHA_WEIGHTS", r_val=qs_control%gapw_control%aweights)
1204 CALL section_vals_val_get(qs_section,
"ORDER_WEIGHTS", i_val=qs_control%gapw_control%oweights)
1207 CALL section_vals_val_get(qs_section,
"PW_GRID", i_val=itmp)
1209 CASE (do_pwgrid_spherical)
1210 qs_control%pw_grid_opt%spherical = .true.
1211 qs_control%pw_grid_opt%fullspace = .false.
1212 CASE (do_pwgrid_ns_fullspace)
1213 qs_control%pw_grid_opt%spherical = .false.
1214 qs_control%pw_grid_opt%fullspace = .true.
1215 CASE (do_pwgrid_ns_halfspace)
1216 qs_control%pw_grid_opt%spherical = .false.
1217 qs_control%pw_grid_opt%fullspace = .false.
1221 CALL section_vals_val_get(qs_section,
"CORE_PPL", i_val=itmp)
1222 qs_control%do_ppl_method = itmp
1224 CALL section_vals_val_get(qs_section,
"PW_GRID_LAYOUT", i_vals=tmplist)
1225 qs_control%pw_grid_opt%distribution_layout = tmplist
1226 CALL section_vals_val_get(qs_section,
"PW_GRID_BLOCKED", i_val=qs_control%pw_grid_opt%blocked)
1229 CALL section_vals_val_get(qs_section,
"EXTRAPOLATION", i_val=qs_control%wf_interpolation_method_nr)
1230 CALL section_vals_val_get(qs_section,
"EXTRAPOLATION_ORDER", i_val=qs_control%wf_extrapolation_order)
1233 CALL section_vals_val_get(qs_section,
"METHOD", i_val=qs_control%method_id)
1234 qs_control%gapw = .false.
1235 qs_control%gapw_xc = .false.
1236 qs_control%gpw = .false.
1237 qs_control%pao = .false.
1238 qs_control%dftb = .false.
1239 qs_control%xtb = .false.
1240 qs_control%semi_empirical = .false.
1241 qs_control%ofgpw = .false.
1242 qs_control%lrigpw = .false.
1243 qs_control%rigpw = .false.
1244 SELECT CASE (qs_control%method_id)
1245 CASE (do_method_gapw)
1246 CALL cite_reference(lippert1999)
1247 CALL cite_reference(krack2000)
1248 qs_control%gapw = .true.
1249 CASE (do_method_gapw_xc)
1250 qs_control%gapw_xc = .true.
1251 CASE (do_method_gpw)
1252 CALL cite_reference(lippert1997)
1253 CALL cite_reference(vandevondele2005a)
1254 qs_control%gpw = .true.
1255 CASE (do_method_ofgpw)
1256 qs_control%ofgpw = .true.
1257 CASE (do_method_lrigpw)
1258 qs_control%lrigpw = .true.
1259 CASE (do_method_rigpw)
1260 qs_control%rigpw = .true.
1261 CASE (do_method_dftb)
1262 qs_control%dftb = .true.
1263 CALL cite_reference(porezag1995)
1264 CALL cite_reference(seifert1996)
1265 CASE (do_method_xtb)
1266 qs_control%xtb = .true.
1267 CALL cite_reference(grimme2017)
1268 CALL cite_reference(pracht2019)
1269 CASE (do_method_mndo)
1270 CALL cite_reference(dewar1977)
1271 qs_control%semi_empirical = .true.
1272 CASE (do_method_am1)
1273 CALL cite_reference(dewar1985)
1274 qs_control%semi_empirical = .true.
1275 CASE (do_method_pm3)
1276 CALL cite_reference(stewart1989)
1277 qs_control%semi_empirical = .true.
1278 CASE (do_method_pnnl)
1279 CALL cite_reference(schenter2008)
1280 qs_control%semi_empirical = .true.
1281 CASE (do_method_pm6)
1282 CALL cite_reference(stewart2007)
1283 qs_control%semi_empirical = .true.
1284 CASE (do_method_pm6fm)
1285 CALL cite_reference(vanvoorhis2015)
1286 qs_control%semi_empirical = .true.
1287 CASE (do_method_pdg)
1288 CALL cite_reference(repasky2002)
1289 qs_control%semi_empirical = .true.
1290 CASE (do_method_rm1)
1291 CALL cite_reference(rocha2006)
1292 qs_control%semi_empirical = .true.
1293 CASE (do_method_mndod)
1294 CALL cite_reference(dewar1977)
1295 CALL cite_reference(thiel1992)
1296 qs_control%semi_empirical = .true.
1299 CALL section_vals_get(mull_section, explicit=qs_control%mulliken_restraint)
1301 IF (qs_control%mulliken_restraint)
THEN
1302 CALL section_vals_val_get(mull_section,
"STRENGTH", r_val=qs_control%mulliken_restraint_control%strength)
1303 CALL section_vals_val_get(mull_section,
"TARGET", r_val=qs_control%mulliken_restraint_control%target)
1304 CALL section_vals_val_get(mull_section,
"ATOMS", n_rep_val=n_rep)
1307 CALL section_vals_val_get(mull_section,
"ATOMS", i_rep_val=k, i_vals=tmplist)
1308 jj = jj +
SIZE(tmplist)
1310 qs_control%mulliken_restraint_control%natoms = jj
1311 IF (qs_control%mulliken_restraint_control%natoms < 1)
THEN
1312 cpabort(
"Need at least 1 atom to use mulliken constraints")
1314 ALLOCATE (qs_control%mulliken_restraint_control%atoms(qs_control%mulliken_restraint_control%natoms))
1317 CALL section_vals_val_get(mull_section,
"ATOMS", i_rep_val=k, i_vals=tmplist)
1318 DO j = 1,
SIZE(tmplist)
1320 qs_control%mulliken_restraint_control%atoms(jj) = tmplist(j)
1324 CALL section_vals_get(ddapc_restraint_section, n_repetition=nrep, explicit=qs_control%ddapc_restraint)
1325 IF (qs_control%ddapc_restraint)
THEN
1326 ALLOCATE (qs_control%ddapc_restraint_control(nrep))
1328 qs_control%ddapc_restraint_is_spin = .false.
1329 qs_control%ddapc_explicit_potential = .false.
1332 CALL section_vals_get(s2_restraint_section, explicit=qs_control%s2_restraint)
1333 IF (qs_control%s2_restraint)
THEN
1334 CALL section_vals_val_get(s2_restraint_section,
"STRENGTH", &
1335 r_val=qs_control%s2_restraint_control%strength)
1336 CALL section_vals_val_get(s2_restraint_section,
"TARGET", &
1337 r_val=qs_control%s2_restraint_control%target)
1338 CALL section_vals_val_get(s2_restraint_section,
"FUNCTIONAL_FORM", &
1339 i_val=qs_control%s2_restraint_control%functional_form)
1342 CALL section_vals_get(cdft_control_section, explicit=qs_control%cdft)
1343 IF (qs_control%cdft)
THEN
1344 CALL read_cdft_control_section(qs_control, cdft_control_section)
1348 IF (qs_control%semi_empirical)
THEN
1349 CALL section_vals_val_get(se_section,
"ORTHOGONAL_BASIS", &
1350 l_val=qs_control%se_control%orthogonal_basis)
1351 CALL section_vals_val_get(se_section,
"DELTA", &
1352 r_val=qs_control%se_control%delta)
1353 CALL section_vals_val_get(se_section,
"ANALYTICAL_GRADIENTS", &
1354 l_val=qs_control%se_control%analytical_gradients)
1355 CALL section_vals_val_get(se_section,
"FORCE_KDSO-D_EXCHANGE", &
1356 l_val=qs_control%se_control%force_kdsod_EX)
1358 CALL section_vals_val_get(se_section,
"INTEGRAL_SCREENING", &
1359 i_val=qs_control%se_control%integral_screening)
1360 IF (qs_control%method_id == do_method_pnnl)
THEN
1361 IF (qs_control%se_control%integral_screening /= do_se_is_slater)
THEN
1362 CALL cp_warn(__location__, &
1363 "PNNL semi-empirical parameterization supports only the Slater type "// &
1364 "integral scheme. Revert to Slater and continue the calculation.")
1366 qs_control%se_control%integral_screening = do_se_is_slater
1369 CALL section_vals_val_get(se_section,
"GA%NCELLS", &
1370 i_val=qs_control%se_control%ga_ncells)
1372 CALL section_vals_val_get(se_section,
"LR_CORRECTION%CUTOFF", &
1373 r_val=qs_control%se_control%cutoff_lrc)
1374 qs_control%se_control%taper_lrc = qs_control%se_control%cutoff_lrc
1375 CALL section_vals_val_get(se_section,
"LR_CORRECTION%RC_TAPER", &
1378 CALL section_vals_val_get(se_section,
"LR_CORRECTION%RC_TAPER", &
1379 r_val=qs_control%se_control%taper_lrc)
1381 CALL section_vals_val_get(se_section,
"LR_CORRECTION%RC_RANGE", &
1382 r_val=qs_control%se_control%range_lrc)
1384 CALL section_vals_val_get(se_section,
"COULOMB%CUTOFF", &
1385 r_val=qs_control%se_control%cutoff_cou)
1386 qs_control%se_control%taper_cou = qs_control%se_control%cutoff_cou
1387 CALL section_vals_val_get(se_section,
"COULOMB%RC_TAPER", &
1390 CALL section_vals_val_get(se_section,
"COULOMB%RC_TAPER", &
1391 r_val=qs_control%se_control%taper_cou)
1393 CALL section_vals_val_get(se_section,
"COULOMB%RC_RANGE", &
1394 r_val=qs_control%se_control%range_cou)
1396 CALL section_vals_val_get(se_section,
"EXCHANGE%CUTOFF", &
1397 r_val=qs_control%se_control%cutoff_exc)
1398 qs_control%se_control%taper_exc = qs_control%se_control%cutoff_exc
1399 CALL section_vals_val_get(se_section,
"EXCHANGE%RC_TAPER", &
1402 CALL section_vals_val_get(se_section,
"EXCHANGE%RC_TAPER", &
1403 r_val=qs_control%se_control%taper_exc)
1405 CALL section_vals_val_get(se_section,
"EXCHANGE%RC_RANGE", &
1406 r_val=qs_control%se_control%range_exc)
1408 IF (qs_control%se_control%integral_screening == do_se_is_kdso_d)
THEN
1409 CALL section_vals_val_get(se_section,
"SCREENING%RC_TAPER", &
1410 r_val=qs_control%se_control%taper_scr)
1411 CALL section_vals_val_get(se_section,
"SCREENING%RC_RANGE", &
1412 r_val=qs_control%se_control%range_scr)
1415 CALL section_vals_val_get(se_section,
"PERIODIC", &
1416 i_val=qs_control%se_control%periodic_type)
1417 SELECT CASE (qs_control%se_control%periodic_type)
1418 CASE (do_se_lr_none)
1419 qs_control%se_control%do_ewald = .false.
1420 qs_control%se_control%do_ewald_r3 = .false.
1421 qs_control%se_control%do_ewald_gks = .false.
1422 CASE (do_se_lr_ewald)
1423 qs_control%se_control%do_ewald = .true.
1424 qs_control%se_control%do_ewald_r3 = .false.
1425 qs_control%se_control%do_ewald_gks = .false.
1426 CASE (do_se_lr_ewald_gks)
1427 qs_control%se_control%do_ewald = .false.
1428 qs_control%se_control%do_ewald_r3 = .false.
1429 qs_control%se_control%do_ewald_gks = .true.
1430 IF (qs_control%method_id /= do_method_pnnl)
THEN
1431 CALL cp_abort(__location__, &
1432 "A periodic semi-empirical calculation was requested with a long-range "// &
1433 "summation on the single integral evaluation. This scheme is supported "// &
1434 "only by the PNNL parameterization.")
1436 CASE (do_se_lr_ewald_r3)
1437 qs_control%se_control%do_ewald = .true.
1438 qs_control%se_control%do_ewald_r3 = .true.
1439 qs_control%se_control%do_ewald_gks = .false.
1440 IF (qs_control%se_control%integral_screening /= do_se_is_kdso)
THEN
1441 CALL cp_abort(__location__, &
1442 "A periodic semi-empirical calculation was requested with a long-range "// &
1443 "summation for the slowly convergent part 1/R^3, which is not congruent "// &
1444 "with the integral screening chosen. The only integral screening supported "// &
1445 "by this periodic type calculation is the standard Klopman-Dewar-Sabelli-Ohno.")
1450 CALL section_vals_val_get(se_section,
"DISPERSION", &
1451 l_val=qs_control%se_control%dispersion)
1452 CALL section_vals_val_get(se_section,
"DISPERSION_RADIUS", &
1453 r_val=qs_control%se_control%rcdisp)
1454 CALL section_vals_val_get(se_section,
"COORDINATION_CUTOFF", &
1455 r_val=qs_control%se_control%epscn)
1456 CALL section_vals_val_get(se_section,
"D3_SCALING", r_vals=scal)
1457 qs_control%se_control%sd3(1) = scal(1)
1458 qs_control%se_control%sd3(2) = scal(2)
1459 qs_control%se_control%sd3(3) = scal(3)
1460 CALL section_vals_val_get(se_section,
"DISPERSION_PARAMETER_FILE", &
1461 c_val=qs_control%se_control%dispersion_parameter_file)
1464 IF (qs_control%se_control%periodic_type == do_se_lr_ewald_r3)
THEN
1465 cpabort(
"EWALD_R3 not implemented yet!")
1468 IF (qs_control%method_id == do_method_mndo .OR. &
1469 qs_control%method_id == do_method_am1 .OR. &
1470 qs_control%method_id == do_method_mndod .OR. &
1471 qs_control%method_id == do_method_pdg .OR. &
1472 qs_control%method_id == do_method_pm3 .OR. &
1473 qs_control%method_id == do_method_pm6 .OR. &
1474 qs_control%method_id == do_method_pm6fm .OR. &
1475 qs_control%method_id == do_method_pnnl .OR. &
1476 qs_control%method_id == do_method_rm1)
THEN
1477 qs_control%se_control%orthogonal_basis = .true.
1482 IF (qs_control%dftb)
THEN
1483 CALL section_vals_val_get(dftb_section,
"ORTHOGONAL_BASIS", &
1484 l_val=qs_control%dftb_control%orthogonal_basis)
1485 CALL section_vals_val_get(dftb_section,
"SELF_CONSISTENT", &
1486 l_val=qs_control%dftb_control%self_consistent)
1487 CALL section_vals_val_get(dftb_section,
"DISPERSION", &
1488 l_val=qs_control%dftb_control%dispersion)
1489 CALL section_vals_val_get(dftb_section,
"DIAGONAL_DFTB3", &
1490 l_val=qs_control%dftb_control%dftb3_diagonal)
1491 CALL section_vals_val_get(dftb_section,
"HB_SR_GAMMA", &
1492 l_val=qs_control%dftb_control%hb_sr_damp)
1493 CALL section_vals_val_get(dftb_section,
"SCC_MIXER", &
1494 explicit=dftb_scc_mixer_explicit)
1495 CALL section_vals_val_get(dftb_section,
"SCC_MIXER", &
1496 i_val=qs_control%dftb_control%tblite_scc_mixer)
1497 CALL section_vals_get(dftb_tblite_mixer, explicit=dftb_tblite_mixer_explicit)
1498 CALL read_tblite_mixer_section(dftb_tblite_mixer, &
1499 qs_control%dftb_control%tblite_mixer_iterations, &
1500 qs_control%dftb_control%tblite_mixer_memory, &
1501 qs_control%dftb_control%tblite_mixer_solver, &
1502 qs_control%dftb_control%tblite_mixer_damping, &
1503 qs_control%dftb_control%tblite_mixer_omega0, &
1504 qs_control%dftb_control%tblite_mixer_min_weight, &
1505 qs_control%dftb_control%tblite_mixer_max_weight, &
1506 qs_control%dftb_control%tblite_mixer_weight_factor, &
1507 "DFTB/TBLITE_MIXER")
1508 IF (qs_control%do_ls_scf)
THEN
1509 IF (dftb_scc_mixer_explicit .AND. &
1510 qs_control%dftb_control%tblite_scc_mixer /= tblite_scc_mixer_none)
THEN
1511 CALL cp_warn(__location__, &
1512 "DFTB/SCC_MIXER is reset to NONE with QS/LS_SCF; LS_SCF optimizes "// &
1513 "the density matrix directly.")
1515 IF (dftb_tblite_mixer_explicit)
THEN
1516 CALL cp_warn(__location__, &
1517 "DFTB/TBLITE_MIXER settings are ignored with QS/LS_SCF; LS_SCF controls "// &
1518 "the density-matrix optimization.")
1520 qs_control%dftb_control%tblite_scc_mixer = tblite_scc_mixer_none
1522 IF (qs_control%dftb_control%tblite_mixer_damping <= 0.0_dp)
THEN
1523 cpabort(
"DFTB/TBLITE_MIXER/DAMPING must be positive")
1525 CALL section_vals_val_get(dftb_section,
"EPS_DISP", &
1526 r_val=qs_control%dftb_control%eps_disp)
1527 CALL section_vals_val_get(dftb_section,
"DO_EWALD", explicit=explicit)
1529 CALL section_vals_val_get(dftb_section,
"DO_EWALD", &
1530 l_val=qs_control%dftb_control%do_ewald)
1532 qs_control%dftb_control%do_ewald = (qs_control%periodicity /= 0)
1534 CALL section_vals_val_get(dftb_parameter,
"PARAM_FILE_PATH", &
1535 c_val=qs_control%dftb_control%sk_file_path)
1536 CALL section_vals_val_get(dftb_parameter,
"PARAM_FILE_NAME", &
1537 c_val=qs_control%dftb_control%sk_file_list)
1538 CALL section_vals_val_get(dftb_parameter,
"HB_SR_PARAM", &
1539 r_val=qs_control%dftb_control%hb_sr_para)
1540 CALL section_vals_val_get(dftb_parameter,
"SK_FILE", n_rep_val=n_var)
1541 ALLOCATE (qs_control%dftb_control%sk_pair_list(3, n_var))
1543 CALL section_vals_val_get(dftb_parameter,
"SK_FILE", i_rep_val=k, &
1545 qs_control%dftb_control%sk_pair_list(1:3, k) = clist(1:3)
1548 CALL section_vals_val_get(dftb_parameter,
"DISPERSION_TYPE", &
1549 i_val=qs_control%dftb_control%dispersion_type)
1550 CALL section_vals_val_get(dftb_parameter,
"UFF_FORCE_FIELD", &
1551 c_val=qs_control%dftb_control%uff_force_field)
1553 CALL section_vals_val_get(dftb_parameter,
"DISPERSION_RADIUS", &
1554 r_val=qs_control%dftb_control%rcdisp)
1555 CALL section_vals_val_get(dftb_parameter,
"COORDINATION_CUTOFF", &
1556 r_val=qs_control%dftb_control%epscn)
1557 CALL section_vals_val_get(dftb_parameter,
"D2_EXP_PRE", &
1558 r_val=qs_control%dftb_control%exp_pre)
1559 CALL section_vals_val_get(dftb_parameter,
"D2_SCALING", &
1560 r_val=qs_control%dftb_control%scaling)
1561 CALL section_vals_val_get(dftb_parameter,
"D3_SCALING", r_vals=scal)
1562 qs_control%dftb_control%sd3(1) = scal(1)
1563 qs_control%dftb_control%sd3(2) = scal(2)
1564 qs_control%dftb_control%sd3(3) = scal(3)
1565 CALL section_vals_val_get(dftb_parameter,
"D3BJ_SCALING", r_vals=scal)
1566 qs_control%dftb_control%sd3bj(1) = scal(1)
1567 qs_control%dftb_control%sd3bj(2) = scal(2)
1568 qs_control%dftb_control%sd3bj(3) = scal(3)
1569 qs_control%dftb_control%sd3bj(4) = scal(4)
1570 CALL section_vals_val_get(dftb_parameter,
"DISPERSION_PARAMETER_FILE", &
1571 c_val=qs_control%dftb_control%dispersion_parameter_file)
1573 IF (qs_control%dftb_control%dispersion)
CALL cite_reference(zhechkov2005)
1574 IF (qs_control%dftb_control%self_consistent)
CALL cite_reference(elstner1998)
1575 IF (qs_control%dftb_control%hb_sr_damp)
CALL cite_reference(hu2007)
1579 IF (qs_control%xtb)
THEN
1580 CALL section_vals_val_get(xtb_section,
"GFN_TYPE", i_val=qs_control%xtb_control%gfn_type)
1581 CALL section_vals_val_get(xtb_tblite,
"_SECTION_PARAMETERS_", l_val=tblite_section_active)
1582 qs_control%xtb_control%do_tblite = (qs_control%xtb_control%gfn_type == gfn_tblite)
1583 IF (qs_control%xtb_control%do_tblite)
THEN
1584 IF (.NOT. tblite_section_active)
THEN
1585 cpabort(
"XTB/GFN_TYPE TBLITE requires an XTB/TBLITE section")
1588 qs_control%xtb_control%gfn_type = gfn1xtb
1589 ELSE IF (tblite_section_active)
THEN
1590 cpabort(
"The XTB/TBLITE section requires XTB/GFN_TYPE TBLITE")
1592 CALL section_vals_val_get(xtb_section,
"SCC_MIXER", &
1593 explicit=xtb_scc_mixer_explicit)
1594 CALL section_vals_val_get(xtb_section,
"SCC_MIXER", &
1595 i_val=qs_control%xtb_control%tblite_scc_mixer)
1596 CALL section_vals_get(xtb_tblite_mixer, explicit=xtb_tblite_mixer_explicit)
1597 CALL read_tblite_mixer_section(xtb_tblite_mixer, &
1598 qs_control%xtb_control%tblite_mixer_iterations, &
1599 qs_control%xtb_control%tblite_mixer_memory, &
1600 qs_control%xtb_control%tblite_mixer_solver, &
1601 qs_control%xtb_control%tblite_mixer_damping, &
1602 qs_control%xtb_control%tblite_mixer_omega0, &
1603 qs_control%xtb_control%tblite_mixer_min_weight, &
1604 qs_control%xtb_control%tblite_mixer_max_weight, &
1605 qs_control%xtb_control%tblite_mixer_weight_factor, &
1607 IF (xtb_tblite_mixer_explicit)
THEN
1608 CALL section_vals_val_get(xtb_tblite_mixer,
"DAMPING", &
1609 explicit=qs_control%xtb_control%tblite_mixer_damping_explicit)
1611 IF ((.NOT. qs_control%xtb_control%do_tblite) .AND. &
1612 qs_control%xtb_control%gfn_type == 0)
THEN
1613 IF (xtb_scc_mixer_explicit .AND. &
1614 qs_control%xtb_control%tblite_scc_mixer /= tblite_scc_mixer_auto .AND. &
1615 qs_control%xtb_control%tblite_scc_mixer /= tblite_scc_mixer_none)
THEN
1616 CALL cp_warn(__location__, &
1617 "XTB/SCC_MIXER is reset to NONE for CP2K-internal GFN0-xTB; "// &
1618 "GFN0-xTB has no SCC variables to mix.")
1620 IF (xtb_tblite_mixer_explicit)
THEN
1621 CALL cp_warn(__location__, &
1622 "XTB/TBLITE_MIXER settings are ignored for CP2K-internal GFN0-xTB; "// &
1623 "GFN0-xTB has no SCC variables to mix.")
1625 qs_control%xtb_control%tblite_scc_mixer = tblite_scc_mixer_none
1627 IF (qs_control%do_ls_scf)
THEN
1628 IF (xtb_scc_mixer_explicit .AND. &
1629 qs_control%xtb_control%tblite_scc_mixer /= tblite_scc_mixer_none)
THEN
1630 CALL cp_warn(__location__, &
1631 "XTB/SCC_MIXER is reset to NONE with QS/LS_SCF; LS_SCF optimizes "// &
1632 "the density matrix directly.")
1634 IF (xtb_tblite_mixer_explicit)
THEN
1635 CALL cp_warn(__location__, &
1636 "XTB/TBLITE_MIXER settings are ignored with QS/LS_SCF; LS_SCF controls "// &
1637 "the density-matrix optimization.")
1639 qs_control%xtb_control%tblite_scc_mixer = tblite_scc_mixer_none
1641 IF (qs_control%xtb_control%tblite_mixer_damping <= 0.0_dp)
THEN
1642 cpabort(
"XTB/TBLITE_MIXER/DAMPING must be positive")
1644 CALL section_vals_val_get(xtb_section,
"DO_EWALD", explicit=explicit)
1646 CALL section_vals_val_get(xtb_section,
"DO_EWALD", &
1647 l_val=qs_control%xtb_control%do_ewald)
1649 qs_control%xtb_control%do_ewald = (qs_control%periodicity /= 0)
1652 CALL section_vals_val_get(xtb_section,
"SPIN_POLARISATION", explicit=explicit)
1653 CALL section_vals_val_get(xtb_section,
"SPIN_POLARISATION", &
1654 l_val=qs_control%xtb_control%do_spinpol)
1655 IF (qs_control%xtb_control%gfn_type == 0)
THEN
1656 IF (explicit .AND. qs_control%xtb_control%do_spinpol)
THEN
1657 cpabort(
"XTB/SPIN_POLARISATION is not available for CP2K-internal GFN0-xTB")
1659 qs_control%xtb_control%do_spinpol = .false.
1662 CALL section_vals_val_get(xtb_section,
"VDW_POTENTIAL", explicit=explicit)
1664 CALL section_vals_val_get(xtb_section,
"VDW_POTENTIAL", c_val=cval)
1665 CALL uppercase(cval)
1668 qs_control%xtb_control%vdw_type = xtb_vdw_type_none
1670 qs_control%xtb_control%vdw_type = xtb_vdw_type_d3
1672 qs_control%xtb_control%vdw_type = xtb_vdw_type_d4
1677 SELECT CASE (qs_control%xtb_control%gfn_type)
1679 qs_control%xtb_control%vdw_type = xtb_vdw_type_d4
1681 qs_control%xtb_control%vdw_type = xtb_vdw_type_d3
1683 qs_control%xtb_control%vdw_type = xtb_vdw_type_d4
1684 cpabort(
"gfn2-xtb tbd")
1690 CALL section_vals_val_get(xtb_section,
"STO_NG", i_val=ngauss)
1691 qs_control%xtb_control%sto_ng = ngauss
1692 CALL section_vals_val_get(xtb_section,
"HYDROGEN_STO_NG", i_val=ngauss)
1693 qs_control%xtb_control%h_sto_ng = ngauss
1694 CALL section_vals_val_get(xtb_section,
"STO_FLEX", explicit=explicit)
1696 CALL section_vals_val_get(xtb_section,
"STO_FLEX", &
1697 l_val=qs_control%xtb_control%sto_flex)
1699 qs_control%xtb_control%sto_flex = .false.
1701 CALL section_vals_val_get(xtb_parameter,
"PARAM_FILE_PATH", &
1702 c_val=qs_control%xtb_control%parameter_file_path)
1703 CALL section_vals_val_get(xtb_parameter,
"PARAM_FILE_NAME", explicit=explicit)
1705 CALL section_vals_val_get(xtb_parameter,
"PARAM_FILE_NAME", &
1706 c_val=qs_control%xtb_control%parameter_file_name)
1708 SELECT CASE (qs_control%xtb_control%gfn_type)
1710 qs_control%xtb_control%parameter_file_name =
"xTB0_parameters"
1712 qs_control%xtb_control%parameter_file_name =
"xTB1_parameters"
1714 cpabort(
"gfn2-xtb tbd")
1720 CALL section_vals_val_get(xtb_parameter,
"SPINPOL_PARAM_FILE_NAME", &
1721 c_val=qs_control%xtb_control%spinpol_param_file_name)
1723 CALL section_vals_val_get(xtb_parameter,
"DISPERSION_RADIUS", &
1724 r_val=qs_control%xtb_control%rcdisp)
1725 CALL section_vals_val_get(xtb_parameter,
"COORDINATION_CUTOFF", &
1726 r_val=qs_control%xtb_control%epscn)
1727 CALL section_vals_val_get(xtb_parameter,
"D3BJ_SCALING", explicit=explicit)
1729 CALL section_vals_val_get(xtb_parameter,
"D3BJ_SCALING", r_vals=scal)
1730 qs_control%xtb_control%s6 = scal(1)
1731 qs_control%xtb_control%s8 = scal(2)
1733 SELECT CASE (qs_control%xtb_control%gfn_type)
1735 qs_control%xtb_control%s6 = 1.00_dp
1736 qs_control%xtb_control%s8 = 2.85_dp
1738 qs_control%xtb_control%s6 = 1.00_dp
1739 qs_control%xtb_control%s8 = 2.40_dp
1741 cpabort(
"gfn2-xtb tbd")
1746 CALL section_vals_val_get(xtb_parameter,
"D3BJ_PARAM", explicit=explicit)
1748 CALL section_vals_val_get(xtb_parameter,
"D3BJ_PARAM", r_vals=scal)
1749 qs_control%xtb_control%a1 = scal(1)
1750 qs_control%xtb_control%a2 = scal(2)
1752 SELECT CASE (qs_control%xtb_control%gfn_type)
1754 qs_control%xtb_control%a1 = 0.80_dp
1755 qs_control%xtb_control%a2 = 4.60_dp
1757 qs_control%xtb_control%a1 = 0.63_dp
1758 qs_control%xtb_control%a2 = 5.00_dp
1760 cpabort(
"gfn2-xtb tbd")
1765 CALL section_vals_val_get(xtb_parameter,
"DISPERSION_PARAMETER_FILE", &
1766 c_val=qs_control%xtb_control%dispersion_parameter_file)
1768 CALL section_vals_val_get(xtb_parameter,
"HUCKEL_CONSTANTS", explicit=explicit)
1770 CALL section_vals_val_get(xtb_parameter,
"HUCKEL_CONSTANTS", r_vals=scal)
1771 qs_control%xtb_control%ks = scal(1)
1772 qs_control%xtb_control%kp = scal(2)
1773 qs_control%xtb_control%kd = scal(3)
1774 qs_control%xtb_control%ksp = scal(4)
1775 qs_control%xtb_control%k2sh = scal(5)
1776 IF (qs_control%xtb_control%gfn_type == 0)
THEN
1778 qs_control%xtb_control%ksp = 0.5_dp*(scal(1) + scal(2))
1781 SELECT CASE (qs_control%xtb_control%gfn_type)
1783 qs_control%xtb_control%ks = 2.00_dp
1784 qs_control%xtb_control%kp = 2.4868_dp
1785 qs_control%xtb_control%kd = 2.27_dp
1786 qs_control%xtb_control%ksp = 2.2434_dp
1787 qs_control%xtb_control%k2sh = 1.1241_dp
1789 qs_control%xtb_control%ks = 1.85_dp
1790 qs_control%xtb_control%kp = 2.25_dp
1791 qs_control%xtb_control%kd = 2.00_dp
1792 qs_control%xtb_control%ksp = 2.08_dp
1793 qs_control%xtb_control%k2sh = 2.85_dp
1795 cpabort(
"gfn2-xtb tbd")
1800 CALL section_vals_val_get(xtb_parameter,
"COULOMB_CONSTANTS", explicit=explicit)
1802 CALL section_vals_val_get(xtb_parameter,
"COULOMB_CONSTANTS", r_vals=scal)
1803 qs_control%xtb_control%kg = scal(1)
1804 qs_control%xtb_control%kf = scal(2)
1806 SELECT CASE (qs_control%xtb_control%gfn_type)
1808 qs_control%xtb_control%kg = 2.00_dp
1809 qs_control%xtb_control%kf = 1.50_dp
1811 qs_control%xtb_control%kg = 2.00_dp
1812 qs_control%xtb_control%kf = 1.50_dp
1814 cpabort(
"gfn2-xtb tbd")
1819 CALL section_vals_val_get(xtb_parameter,
"CN_CONSTANTS", r_vals=scal)
1820 qs_control%xtb_control%kcns = scal(1)
1821 qs_control%xtb_control%kcnp = scal(2)
1822 qs_control%xtb_control%kcnd = scal(3)
1824 CALL section_vals_val_get(xtb_parameter,
"EN_CONSTANTS", explicit=explicit)
1826 CALL section_vals_val_get(xtb_parameter,
"EN_CONSTANTS", r_vals=scal)
1827 SELECT CASE (qs_control%xtb_control%gfn_type)
1829 qs_control%xtb_control%ksen = scal(1)
1830 qs_control%xtb_control%kpen = scal(2)
1831 qs_control%xtb_control%kden = scal(3)
1833 qs_control%xtb_control%ken = scal(1)
1835 cpabort(
"gfn2-xtb tbd")
1840 SELECT CASE (qs_control%xtb_control%gfn_type)
1842 qs_control%xtb_control%ksen = 0.006_dp
1843 qs_control%xtb_control%kpen = -0.001_dp
1844 qs_control%xtb_control%kden = -0.002_dp
1846 qs_control%xtb_control%ken = -0.007_dp
1848 cpabort(
"gfn2-xtb tbd")
1854 CALL section_vals_val_get(xtb_parameter,
"BEN_CONSTANT", r_vals=scal)
1855 qs_control%xtb_control%ben = scal(1)
1857 CALL section_vals_val_get(xtb_parameter,
"ENSCALE", explicit=explicit)
1859 CALL section_vals_val_get(xtb_parameter,
"ENSCALE", &
1860 r_val=qs_control%xtb_control%enscale)
1862 SELECT CASE (qs_control%xtb_control%gfn_type)
1864 qs_control%xtb_control%enscale = -0.09_dp
1866 qs_control%xtb_control%enscale = 0._dp
1868 cpabort(
"gfn2-xtb tbd")
1874 CALL section_vals_val_get(xtb_section,
"USE_HALOGEN_CORRECTION", &
1875 l_val=qs_control%xtb_control%xb_interaction)
1876 CALL section_vals_val_get(xtb_parameter,
"HALOGEN_BINDING", r_vals=scal)
1877 qs_control%xtb_control%kxr = scal(1)
1878 qs_control%xtb_control%kx2 = scal(2)
1880 CALL section_vals_val_get(xtb_section,
"DO_NONBONDED", &
1881 l_val=qs_control%xtb_control%do_nonbonded)
1882 CALL section_vals_get(nonbonded_section, explicit=explicit)
1883 IF (explicit .AND. qs_control%xtb_control%do_nonbonded)
THEN
1884 CALL section_vals_get(genpot_section, explicit=explicit, n_repetition=ngp)
1886 CALL pair_potential_reallocate(qs_control%xtb_control%nonbonded, 1, ngp, gp=.true.)
1887 CALL read_gp_section(qs_control%xtb_control%nonbonded, genpot_section, 0)
1890 CALL section_vals_val_get(xtb_section,
"EPS_PAIRPOTENTIAL", &
1891 r_val=qs_control%xtb_control%eps_pair)
1893 CALL section_vals_val_get(xtb_parameter,
"COULOMB_SR_CUT", r_vals=scal)
1894 qs_control%xtb_control%coulomb_sr_cut = scal(1)
1895 CALL section_vals_val_get(xtb_parameter,
"COULOMB_SR_EPS", r_vals=scal)
1896 qs_control%xtb_control%coulomb_sr_eps = scal(1)
1898 CALL section_vals_val_get(xtb_parameter,
"XB_RADIUS", r_val=qs_control%xtb_control%xb_radius)
1900 CALL section_vals_val_get(xtb_parameter,
"KAB_PARAM", n_rep_val=n_rep)
1902 SELECT CASE (qs_control%xtb_control%gfn_type)
1904 qs_control%xtb_control%coulomb_interaction = .false.
1905 qs_control%xtb_control%coulomb_lr = .false.
1906 qs_control%xtb_control%tb3_interaction = .false.
1907 qs_control%xtb_control%check_atomic_charges = .false.
1908 CALL section_vals_val_get(xtb_section,
"VARIATIONAL_DIPOLE", &
1909 l_val=qs_control%xtb_control%var_dipole)
1912 CALL section_vals_val_get(xtb_section,
"COULOMB_INTERACTION", &
1913 l_val=qs_control%xtb_control%coulomb_interaction)
1914 CALL section_vals_val_get(xtb_section,
"COULOMB_LR", &
1915 l_val=qs_control%xtb_control%coulomb_lr)
1916 CALL section_vals_val_get(xtb_section,
"TB3_INTERACTION", &
1917 l_val=qs_control%xtb_control%tb3_interaction)
1919 CALL section_vals_val_get(xtb_section,
"CHECK_ATOMIC_CHARGES", &
1920 l_val=qs_control%xtb_control%check_atomic_charges)
1921 qs_control%xtb_control%var_dipole = .false.
1923 cpabort(
"gfn2-xtb tbd")
1927 qs_control%xtb_control%kab_nval = n_rep
1929 ALLOCATE (qs_control%xtb_control%kab_param(3, n_rep))
1930 ALLOCATE (qs_control%xtb_control%kab_types(2, n_rep))
1931 ALLOCATE (qs_control%xtb_control%kab_vals(n_rep))
1933 CALL section_vals_val_get(xtb_parameter,
"KAB_PARAM", i_rep_val=j, c_vals=clist)
1934 qs_control%xtb_control%kab_param(1, j) = clist(1)
1935 CALL get_ptable_info(clist(1) (1:2), &
1936 ielement=qs_control%xtb_control%kab_types(1, j))
1937 qs_control%xtb_control%kab_param(2, j) = clist(2)
1938 CALL get_ptable_info(clist(2) (1:2), &
1939 ielement=qs_control%xtb_control%kab_types(2, j))
1940 qs_control%xtb_control%kab_param(3, j) = clist(3)
1941 READ (clist(3),
'(F10.0)') qs_control%xtb_control%kab_vals(j)
1946 CALL section_vals_val_get(xtb_parameter,
"SPIN_POL_PARAM", n_rep_val=n_rep)
1948 ALLOCATE (qs_control%xtb_control%spinpol_type(n_rep))
1949 ALLOCATE (qs_control%xtb_control%spinpol_vals(6, n_rep))
1951 CALL section_vals_val_get(xtb_parameter,
"SPIN_POL_PARAM", i_rep_val=j, c_vals=clist)
1952 READ (clist(1),
'(A)') cval
1953 element_symbol = adjustl(trim(cval))
1954 CALL get_ptable_info(element_symbol, znum)
1955 qs_control%xtb_control%spinpol_type(j) = znum
1956 READ (clist(2),
'(F20.8)') qs_control%xtb_control%spinpol_vals(1, j)
1957 READ (clist(3),
'(F20.8)') qs_control%xtb_control%spinpol_vals(2, j)
1958 READ (clist(4),
'(F20.8)') qs_control%xtb_control%spinpol_vals(3, j)
1959 READ (clist(5),
'(F20.8)') qs_control%xtb_control%spinpol_vals(4, j)
1960 READ (clist(6),
'(F20.8)') qs_control%xtb_control%spinpol_vals(5, j)
1961 READ (clist(7),
'(F20.8)') qs_control%xtb_control%spinpol_vals(6, j)
1965 IF (qs_control%xtb_control%gfn_type == 0)
THEN
1966 CALL section_vals_val_get(xtb_parameter,
"SRB_PARAMETER", r_vals=scal)
1967 qs_control%xtb_control%ksrb = scal(1)
1968 qs_control%xtb_control%esrb = scal(2)
1969 qs_control%xtb_control%gscal = scal(3)
1970 qs_control%xtb_control%c1srb = scal(4)
1971 qs_control%xtb_control%c2srb = scal(5)
1972 qs_control%xtb_control%shift = scal(6)
1975 CALL section_vals_val_get(xtb_section,
"EN_SHIFT_TYPE", c_val=cval)
1976 CALL uppercase(cval)
1977 SELECT CASE (trim(cval))
1979 qs_control%xtb_control%enshift_type = 0
1981 qs_control%xtb_control%enshift_type = 1
1983 qs_control%xtb_control%enshift_type = 2
1985 cpabort(
"Unknown value for EN_SHIFT_TYPE")
1989 CALL read_eeq_param(eeq_section, qs_control%xtb_control%eeq_sparam)
1993 CALL section_vals_get(lri_optbas_section, explicit=qs_control%lri_optbas)
1996 IF (qs_control%xtb_control%do_tblite)
THEN
1997 CALL section_vals_val_get(xtb_tblite,
"METHOD", &
1998 i_val=qs_control%xtb_control%tblite_method)
1999 CALL section_vals_val_get(xtb_tblite,
"PARAM", &
2000 c_val=qs_control%xtb_control%tblite_param_file)
2001 CALL section_vals_val_get(xtb_tblite,
"ACCURACY", &
2002 r_val=qs_control%xtb_control%tblite_accuracy)
2003 IF (qs_control%xtb_control%tblite_accuracy <= 0.0_dp)
THEN
2004 cpabort(
"XTB/TBLITE/ACCURACY must be positive")
2006 IF (qs_control%xtb_control%tblite_mixer_damping <= 0.0_dp)
THEN
2007 cpabort(
"XTB/TBLITE_MIXER/DAMPING must be positive")
2010 CALL section_vals_get(xtb_tblite_ref_cli, explicit=tblite_reference_cli_section)
2012 cpabort(
"XTB/TBLITE/REFERENCE_CLI keyword requires an XTB/TBLITE/REFERENCE_CLI section")
2015 CALL read_xtb_reference_cli_section(xtb_tblite_ref_cli, qs_control%xtb_control%reference_cli, cell)
2016 qs_control%xtb_control%reference_cli%enabled = .true.
2018 CALL cite_reference(katbashev2025)
2024 CALL timestop(handle)
2040 SUBROUTINE read_tblite_mixer_section(mixer_section, iterations, memory, solver, damping, omega0, min_weight, &
2041 max_weight, weight_factor, section_name)
2042 TYPE(section_vals_type),
POINTER :: mixer_section
2043 INTEGER,
INTENT(INOUT) :: iterations, memory, solver
2044 REAL(kind=dp),
INTENT(INOUT) :: damping, omega0, min_weight, max_weight, &
2046 CHARACTER(LEN=*),
INTENT(IN) :: section_name
2048 LOGICAL :: explicit, memory_explicit
2050 CALL section_vals_get(mixer_section, explicit=explicit)
2051 IF (.NOT. explicit)
RETURN
2053 CALL section_vals_val_get(mixer_section,
"ITERATIONS", i_val=iterations)
2054 CALL section_vals_val_get(mixer_section,
"MEMORY", explicit=memory_explicit)
2055 IF (memory_explicit)
CALL section_vals_val_get(mixer_section,
"MEMORY", i_val=memory)
2056 IF (.NOT. memory_explicit .OR. memory == tblite_mixer_memory_inherit)
THEN
2059 CALL section_vals_val_get(mixer_section,
"SOLVER", i_val=solver)
2060 CALL section_vals_val_get(mixer_section,
"DAMPING", r_val=damping)
2061 CALL section_vals_val_get(mixer_section,
"OMEGA0", r_val=omega0)
2062 CALL section_vals_val_get(mixer_section,
"MIN_WEIGHT", r_val=min_weight)
2063 CALL section_vals_val_get(mixer_section,
"MAX_WEIGHT", r_val=max_weight)
2064 CALL section_vals_val_get(mixer_section,
"WEIGHT_FACTOR", r_val=weight_factor)
2066 IF (iterations < 1) cpabort(trim(section_name)//
"/ITERATIONS must be positive")
2067 IF (memory < 1) cpabort(trim(section_name)//
"/MEMORY must be positive")
2068 SELECT CASE (solver)
2069 CASE (tblite_solver_gvd, tblite_solver_gvr)
2071 cpabort(trim(section_name)//
"/SOLVER must be GVD or GVR")
2073 IF (damping <= 0.0_dp) cpabort(trim(section_name)//
"/DAMPING must be positive")
2074 IF (omega0 <= 0.0_dp) cpabort(trim(section_name)//
"/OMEGA0 must be positive")
2075 IF (min_weight <= 0.0_dp) cpabort(trim(section_name)//
"/MIN_WEIGHT must be positive")
2076 IF (max_weight <= 0.0_dp) cpabort(trim(section_name)//
"/MAX_WEIGHT must be positive")
2077 IF (max_weight < min_weight)
THEN
2078 cpabort(trim(section_name)//
"/MAX_WEIGHT must not be smaller than MIN_WEIGHT")
2080 IF (weight_factor <= 0.0_dp) cpabort(trim(section_name)//
"/WEIGHT_FACTOR must be positive")
2082 END SUBROUTINE read_tblite_mixer_section
2090 SUBROUTINE read_xtb_reference_cli_section(ref_cli_section, ref_cli, cell)
2091 TYPE(section_vals_type),
POINTER :: ref_cli_section
2092 TYPE(xtb_reference_cli_type),
INTENT(INOUT) :: ref_cli
2093 TYPE(cell_type),
OPTIONAL,
POINTER :: cell
2095 REAL(kind=dp),
DIMENSION(:),
POINTER :: efield
2096 TYPE(section_vals_type),
POINTER :: fit_section, guess_section, &
2097 param_section, solvation_section, &
2100 CALL section_vals_val_get(ref_cli_section,
"_SECTION_PARAMETERS_", l_val=ref_cli%enabled)
2101 CALL section_vals_val_get(ref_cli_section,
"PROGRAM_NAME", c_val=ref_cli%program_name)
2102 CALL section_vals_val_get(ref_cli_section,
"GUESS", i_val=ref_cli%guess)
2103 CALL section_vals_val_get(ref_cli_section,
"WORK_DIRECTORY", c_val=ref_cli%work_directory)
2104 CALL section_vals_val_get(ref_cli_section,
"PREFIX", c_val=ref_cli%prefix)
2105 CALL section_vals_val_get(ref_cli_section,
"INPUT_FORMAT", c_val=ref_cli%input_format)
2106 CALL section_vals_val_get(ref_cli_section,
"RESTART", c_val=ref_cli%restart_file)
2107 CALL section_vals_val_get(ref_cli_section,
"GRAD", c_val=ref_cli%grad_file)
2108 CALL section_vals_val_get(ref_cli_section,
"JSON", c_val=ref_cli%json_file)
2109 CALL section_vals_val_get(ref_cli_section,
"POST_PROCESSING", c_val=ref_cli%post_processing)
2110 CALL section_vals_val_get(ref_cli_section,
"POST_PROCESSING_OUTPUT", &
2111 c_val=ref_cli%post_processing_output_file)
2112 CALL section_vals_val_get(ref_cli_section,
"EFIELD", explicit=ref_cli%efield_active)
2113 IF (ref_cli%efield_active)
THEN
2115 CALL section_vals_val_get(ref_cli_section,
"EFIELD", r_vals=efield)
2116 ref_cli%efield = efield(1:3)
2117 IF (
PRESENT(cell))
THEN
2118 IF (
ASSOCIATED(cell))
CALL cell_transform_input_cartesian(cell, ref_cli%efield)
2121 solvation_section => section_vals_get_subs_vals(ref_cli_section,
"IMPLICIT_SOLVATION")
2122 CALL section_vals_get(solvation_section, explicit=ref_cli%solvation_active)
2123 IF (ref_cli%solvation_active)
THEN
2124 CALL section_vals_val_get(solvation_section,
"MODEL", i_val=ref_cli%solvation_model)
2125 CALL section_vals_val_get(solvation_section,
"SOLVENT", c_val=ref_cli%solvation_solvent)
2126 CALL section_vals_val_get(solvation_section,
"BORN_KERNEL", i_val=ref_cli%solvation_born_kernel)
2127 CALL section_vals_val_get(solvation_section,
"SOLUTION_STATE", i_val=ref_cli%solvation_state)
2128 IF (len_trim(ref_cli%solvation_solvent) == 0)
THEN
2129 cpabort(
"REFERENCE_CLI implicit solvation needs SOLVENT")
2131 IF (ref_cli%solvation_model == tblite_cli_solvation_cpcm .AND. &
2132 ref_cli%solvation_born_kernel /= tblite_cli_born_kernel_auto)
THEN
2133 cpabort(
"BORN_KERNEL is invalid with MODEL CPCM")
2135 IF (ref_cli%solvation_state /= tblite_cli_solution_state_gsolv)
THEN
2136 SELECT CASE (ref_cli%solvation_model)
2137 CASE (tblite_cli_solvation_alpb, tblite_cli_solvation_gbsa)
2139 CASE (tblite_cli_solvation_gbe, tblite_cli_solvation_gb, tblite_cli_solvation_cpcm)
2140 cpabort(
"SOLUTION_STATE is valid only for ALPB/GBSA")
2144 CALL section_vals_val_get(ref_cli_section,
"ELECTRONIC_TEMPERATURE_GUESS", &
2145 r_val=ref_cli%electronic_temperature_guess)
2146 IF (ref_cli%electronic_temperature_guess < 0.0_dp)
THEN
2147 cpabort(
"XTB/TBLITE/REFERENCE_CLI/ELECTRONIC_TEMPERATURE_GUESS must not be negative")
2149 IF (ref_cli%electronic_temperature_guess > 0.0_dp .AND. ref_cli%guess /= tblite_guess_ceh)
THEN
2150 cpabort(
"XTB/TBLITE/REFERENCE_CLI/ELECTRONIC_TEMPERATURE_GUESS requires GUESS CEH")
2152 guess_section => section_vals_get_subs_vals(ref_cli_section,
"GUESS_CLI")
2153 CALL section_vals_get(guess_section, explicit=ref_cli%guess_cli%enabled)
2154 IF (ref_cli%guess_cli%enabled)
THEN
2155 CALL section_vals_val_get(guess_section,
"METHOD", i_val=ref_cli%guess_cli%method)
2156 CALL section_vals_val_get(guess_section,
"ELECTRONIC_TEMPERATURE_GUESS", &
2157 r_val=ref_cli%guess_cli%electronic_temperature_guess)
2158 IF (ref_cli%guess_cli%electronic_temperature_guess < 0.0_dp)
THEN
2159 cpabort(
"REFERENCE_CLI/GUESS_CLI/ELECTRONIC_TEMPERATURE_GUESS must not be negative")
2161 CALL section_vals_val_get(guess_section,
"SOLVER", i_val=ref_cli%guess_cli%solver)
2162 CALL section_vals_val_get(guess_section,
"EFIELD", explicit=ref_cli%guess_cli%efield_active)
2163 IF (ref_cli%guess_cli%efield_active)
THEN
2165 CALL section_vals_val_get(guess_section,
"EFIELD", r_vals=efield)
2166 ref_cli%guess_cli%efield = efield(1:3)
2167 IF (
PRESENT(cell))
THEN
2168 IF (
ASSOCIATED(cell))
CALL cell_transform_input_cartesian(cell, ref_cli%guess_cli%efield)
2171 CALL section_vals_val_get(guess_section,
"GRAD", l_val=ref_cli%guess_cli%grad)
2172 CALL section_vals_val_get(guess_section,
"JSON", c_val=ref_cli%guess_cli%json_file)
2173 CALL section_vals_val_get(guess_section,
"INPUT_FORMAT", c_val=ref_cli%guess_cli%input_format)
2174 CALL section_vals_val_get(guess_section,
"INPUT_FILE", c_val=ref_cli%guess_cli%input_file)
2176 param_section => section_vals_get_subs_vals(ref_cli_section,
"PARAM_CLI")
2177 CALL section_vals_get(param_section, explicit=ref_cli%param_cli%enabled)
2178 IF (ref_cli%param_cli%enabled)
THEN
2179 CALL section_vals_val_get(param_section,
"METHOD", explicit=ref_cli%param_cli%method_explicit, &
2180 i_val=ref_cli%param_cli%method)
2181 CALL section_vals_val_get(param_section,
"OUTPUT", c_val=ref_cli%param_cli%output_file)
2182 CALL section_vals_val_get(param_section,
"INPUT_FILE", c_val=ref_cli%param_cli%input_file)
2184 fit_section => section_vals_get_subs_vals(ref_cli_section,
"FIT_CLI")
2185 CALL section_vals_get(fit_section, explicit=ref_cli%fit_cli%enabled)
2186 IF (ref_cli%fit_cli%enabled)
THEN
2187 CALL section_vals_val_get(fit_section,
"PARAM_FILE", c_val=ref_cli%fit_cli%param_file)
2188 CALL section_vals_val_get(fit_section,
"INPUT_FILE", c_val=ref_cli%fit_cli%input_file)
2189 CALL section_vals_val_get(fit_section,
"DRY_RUN", l_val=ref_cli%fit_cli%dry_run)
2190 CALL section_vals_val_get(fit_section,
"COPY", c_val=ref_cli%fit_cli%copy_file)
2191 IF (len_trim(ref_cli%fit_cli%param_file) == 0)
THEN
2192 cpabort(
"XTB/TBLITE/REFERENCE_CLI/FIT_CLI needs PARAM_FILE")
2194 IF (len_trim(ref_cli%fit_cli%input_file) == 0)
THEN
2195 cpabort(
"XTB/TBLITE/REFERENCE_CLI/FIT_CLI needs INPUT_FILE")
2198 tagdiff_section => section_vals_get_subs_vals(ref_cli_section,
"TAGDIFF_CLI")
2199 CALL section_vals_get(tagdiff_section, explicit=ref_cli%tagdiff_cli%enabled)
2200 IF (ref_cli%tagdiff_cli%enabled)
THEN
2201 CALL section_vals_val_get(tagdiff_section,
"ACTUAL", c_val=ref_cli%tagdiff_cli%actual_file)
2202 CALL section_vals_val_get(tagdiff_section,
"REFERENCE", c_val=ref_cli%tagdiff_cli%reference_file)
2203 CALL section_vals_val_get(tagdiff_section,
"FIT", l_val=ref_cli%tagdiff_cli%fit)
2204 IF (len_trim(ref_cli%tagdiff_cli%actual_file) == 0)
THEN
2205 cpabort(
"XTB/TBLITE/REFERENCE_CLI/TAGDIFF_CLI needs ACTUAL")
2207 IF (len_trim(ref_cli%tagdiff_cli%reference_file) == 0)
THEN
2208 cpabort(
"XTB/TBLITE/REFERENCE_CLI/TAGDIFF_CLI needs REFERENCE")
2211 CALL section_vals_val_get(ref_cli_section,
"KEEP_FILES", l_val=ref_cli%keep_files)
2212 CALL section_vals_val_get(ref_cli_section,
"ERROR_LIMIT", r_val=ref_cli%error_limit)
2213 CALL section_vals_val_get(ref_cli_section,
"STOP_ON_ERROR", l_val=ref_cli%stop_on_error)
2214 CALL section_vals_val_get(ref_cli_section,
"CHECK_ENERGY", l_val=ref_cli%check_energy)
2215 CALL section_vals_val_get(ref_cli_section,
"CHECK_FORCES", l_val=ref_cli%check_forces)
2216 CALL section_vals_val_get(ref_cli_section,
"CHECK_VIRIAL", l_val=ref_cli%check_virial)
2218 END SUBROUTINE read_xtb_reference_cli_section
2227 TYPE(tddfpt2_control_type),
POINTER :: t_control
2228 TYPE(section_vals_type),
POINTER :: t_section
2229 TYPE(qs_control_type),
POINTER :: qs_control
2231 CHARACTER(LEN=*),
PARAMETER :: routinen =
'read_tddfpt2_control'
2233 CHARACTER(LEN=default_string_length), &
2234 DIMENSION(:),
POINTER :: tmpstringlist
2235 INTEGER :: handle, irep, isize, nrep
2236 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: inds
2237 LOGICAL :: do_ewald, do_exchange, expl, explicit, &
2239 REAL(kind=dp) :: filter, fval, hfx
2240 TYPE(section_vals_type),
POINTER :: dipole_section, mgrid_section, &
2241 soc_section, stda_section, xc_func, &
2244 CALL timeset(routinen, handle)
2246 CALL section_vals_val_get(t_section,
"_SECTION_PARAMETERS_", l_val=t_control%enabled)
2248 CALL section_vals_val_get(t_section,
"NSTATES", i_val=t_control%nstates)
2249 CALL section_vals_val_get(t_section,
"MAX_ITER", i_val=t_control%niters)
2250 CALL section_vals_val_get(t_section,
"MAX_KV", i_val=t_control%nkvs)
2251 CALL section_vals_val_get(t_section,
"NLUMO", i_val=t_control%nlumo)
2252 CALL section_vals_val_get(t_section,
"NPROC_STATE", i_val=t_control%nprocs)
2253 CALL section_vals_val_get(t_section,
"KERNEL", i_val=t_control%kernel)
2254 CALL section_vals_val_get(t_section,
"SPINFLIP", i_val=t_control%spinflip)
2255 CALL section_vals_val_get(t_section,
"OE_CORR", i_val=t_control%oe_corr)
2256 CALL section_vals_val_get(t_section,
"EV_SHIFT", r_val=t_control%ev_shift)
2257 CALL section_vals_val_get(t_section,
"EOS_SHIFT", r_val=t_control%eos_shift)
2259 CALL section_vals_val_get(t_section,
"CONVERGENCE", r_val=t_control%conv)
2260 CALL section_vals_val_get(t_section,
"MIN_AMPLITUDE", r_val=t_control%min_excitation_amplitude)
2261 CALL section_vals_val_get(t_section,
"ORTHOGONAL_EPS", r_val=t_control%orthogonal_eps)
2263 CALL section_vals_val_get(t_section,
"RESTART", l_val=t_control%is_restart)
2264 CALL section_vals_val_get(t_section,
"RKS_TRIPLETS", l_val=t_control%rks_triplets)
2265 CALL section_vals_val_get(t_section,
"DO_LRIGPW", l_val=t_control%do_lrigpw)
2266 CALL section_vals_val_get(t_section,
"DO_SMEARING", l_val=t_control%do_smearing)
2267 CALL section_vals_val_get(t_section,
"DO_BSE", l_val=t_control%do_bse)
2268 CALL section_vals_val_get(t_section,
"DO_BSE_W_ONLY", l_val=t_control%do_bse_w_only)
2269 CALL section_vals_val_get(t_section,
"DO_BSE_GW_ONLY", l_val=t_control%do_bse_gw_only)
2270 CALL section_vals_val_get(t_section,
"ADMM_KERNEL_CORRECTION_SYMMETRIC", l_val=t_control%admm_symm)
2271 CALL section_vals_val_get(t_section,
"ADMM_KERNEL_XC_CORRECTION", l_val=t_control%admm_xc_correction)
2272 CALL section_vals_val_get(t_section,
"EXCITON_DESCRIPTORS", l_val=t_control%do_exciton_descriptors)
2273 CALL section_vals_val_get(t_section,
"DIRECTIONAL_EXCITON_DESCRIPTORS", l_val=t_control%do_directional_exciton_descriptors)
2274 CALL section_vals_val_get(t_section,
"DIRECTIONAL_EXCITON_CROSSCORRELATION", &
2275 l_val=t_control%do_directional_exciton_crosscorrelation, explicit=explicit)
2276 IF (explicit .AND. t_control%do_directional_exciton_crosscorrelation .AND. &
2277 .NOT. t_control%do_directional_exciton_descriptors)
THEN
2278 CALL cp_warn(__location__, &
2279 "DIRECTIONAL_EXCITON_CROSSCORRELATION has no effect without DIRECTIONAL_EXCITON_DESCRIPTORS.")
2283 CALL section_vals_val_get(t_section,
"AUTO_BASIS", n_rep_val=nrep)
2285 CALL section_vals_val_get(t_section,
"AUTO_BASIS", i_rep_val=irep, c_vals=tmpstringlist)
2286 IF (
SIZE(tmpstringlist) == 2)
THEN
2287 CALL uppercase(tmpstringlist(2))
2288 SELECT CASE (tmpstringlist(2))
2290 SELECT CASE (tmpstringlist(1))
2294 CALL cp_abort(__location__, &
2295 "AUTO_BASIS: the size <X> is invalid for the "// &
2296 "type <"//trim(adjustl(tmpstringlist(1)))//
">; "// &
2297 "use one of SMALL, MEDIUM, LARGE, HUGE for "// &
2298 "the size. The syntax AUTO_BASIS X X is a "// &
2299 "reserved case for using NO automatically "// &
2300 "generated basis sets.")
2311 cpabort(
"Unknown basis size in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
2314 SELECT CASE (tmpstringlist(1))
2317 t_control%auto_basis_p_lri_aux = isize
2319 cpabort(
"Unknown basis type in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
2322 CALL cp_abort(__location__, &
2323 "AUTO_BASIS keyword in &PROPERTIES &TDDFT section has a wrong number of arguments.")
2327 IF (t_control%conv < 0)
THEN
2328 t_control%conv = abs(t_control%conv)
2332 dipole_section => section_vals_get_subs_vals(t_section,
"DIPOLE_MOMENTS")
2333 CALL section_vals_val_get(dipole_section,
"DIPOLE_FORM", explicit=explicit)
2335 CALL section_vals_val_get(dipole_section,
"DIPOLE_FORM", i_val=t_control%dipole_form)
2337 t_control%dipole_form = 0
2339 CALL section_vals_val_get(dipole_section,
"REFERENCE", i_val=t_control%dipole_reference)
2340 CALL section_vals_val_get(dipole_section,
"REFERENCE_POINT", explicit=explicit)
2342 CALL section_vals_val_get(dipole_section,
"REFERENCE_POINT", r_vals=t_control%dipole_ref_point)
2344 NULLIFY (t_control%dipole_ref_point)
2345 IF (t_control%dipole_form == tddfpt_dipole_length .AND. t_control%dipole_reference == use_mom_ref_user)
THEN
2346 cpabort(
"User-defined reference point should be given explicitly")
2351 soc_section => section_vals_get_subs_vals(t_section,
"SOC")
2352 CALL section_vals_get(soc_section, explicit=explicit)
2354 t_control%do_soc = .true.
2358 mgrid_section => section_vals_get_subs_vals(t_section,
"MGRID")
2359 CALL section_vals_get(mgrid_section, explicit=t_control%mgrid_is_explicit)
2361 IF (t_control%mgrid_is_explicit)
THEN
2362 CALL section_vals_val_get(mgrid_section,
"NGRIDS", i_val=t_control%mgrid_ngrids, explicit=explicit)
2363 IF (.NOT. explicit) t_control%mgrid_ngrids =
SIZE(qs_control%e_cutoff)
2365 CALL section_vals_val_get(mgrid_section,
"CUTOFF", r_val=t_control%mgrid_cutoff, explicit=explicit)
2366 IF (.NOT. explicit) t_control%mgrid_cutoff = qs_control%cutoff
2368 CALL section_vals_val_get(mgrid_section,
"PROGRESSION_FACTOR", &
2369 r_val=t_control%mgrid_progression_factor, explicit=explicit)
2371 IF (t_control%mgrid_progression_factor <= 1.0_dp)
THEN
2372 CALL cp_abort(__location__, &
2373 "Progression factor should be greater then 1.0 to ensure multi-grid ordering")
2376 t_control%mgrid_progression_factor = qs_control%progression_factor
2379 CALL section_vals_val_get(mgrid_section,
"COMMENSURATE", l_val=t_control%mgrid_commensurate_mgrids, explicit=explicit)
2380 IF (.NOT. explicit) t_control%mgrid_commensurate_mgrids = qs_control%commensurate_mgrids
2381 IF (t_control%mgrid_commensurate_mgrids)
THEN
2383 t_control%mgrid_progression_factor = 4.0_dp
2385 t_control%mgrid_progression_factor = qs_control%progression_factor
2389 CALL section_vals_val_get(mgrid_section,
"REL_CUTOFF", r_val=t_control%mgrid_relative_cutoff, explicit=explicit)
2390 IF (.NOT. explicit) t_control%mgrid_relative_cutoff = qs_control%relative_cutoff
2392 CALL section_vals_val_get(mgrid_section,
"MULTIGRID_SET", l_val=multigrid_set, explicit=explicit)
2393 IF (.NOT. explicit) multigrid_set = .false.
2394 IF (multigrid_set)
THEN
2395 CALL section_vals_val_get(mgrid_section,
"MULTIGRID_CUTOFF", r_vals=t_control%mgrid_e_cutoff)
2397 NULLIFY (t_control%mgrid_e_cutoff)
2400 CALL section_vals_val_get(mgrid_section,
"REALSPACE", l_val=t_control%mgrid_realspace_mgrids, explicit=explicit)
2401 IF (.NOT. explicit) t_control%mgrid_realspace_mgrids = qs_control%realspace_mgrids
2403 CALL section_vals_val_get(mgrid_section,
"SKIP_LOAD_BALANCE_DISTRIBUTED", &
2404 l_val=t_control%mgrid_skip_load_balance, explicit=explicit)
2405 IF (.NOT. explicit) t_control%mgrid_skip_load_balance = qs_control%skip_load_balance_distributed
2407 IF (
ASSOCIATED(t_control%mgrid_e_cutoff))
THEN
2408 IF (
SIZE(t_control%mgrid_e_cutoff) /= t_control%mgrid_ngrids)
THEN
2409 cpabort(
"Inconsistent values for number of multi-grids")
2413 t_control%mgrid_e_cutoff = -t_control%mgrid_e_cutoff
2414 ALLOCATE (inds(t_control%mgrid_ngrids))
2415 CALL sort(t_control%mgrid_e_cutoff, t_control%mgrid_ngrids, inds)
2417 t_control%mgrid_e_cutoff = -t_control%mgrid_e_cutoff
2422 xc_section => section_vals_get_subs_vals(t_section,
"XC")
2423 xc_func => section_vals_get_subs_vals(xc_section,
"XC_FUNCTIONAL")
2424 CALL section_vals_get(xc_func, explicit=explicit)
2426 CALL xc_functionals_expand(xc_func, xc_section)
2430 stda_section => section_vals_get_subs_vals(t_section,
"STDA")
2431 IF (t_control%kernel == tddfpt_kernel_stda)
THEN
2432 t_control%stda_control%hfx_fraction = 0.0_dp
2433 t_control%stda_control%do_exchange = .true.
2434 t_control%stda_control%eps_td_filter = 1.e-10_dp
2435 t_control%stda_control%mn_alpha = -99.0_dp
2436 t_control%stda_control%mn_beta = -99.0_dp
2438 SELECT CASE (qs_control%periodicity)
2440 t_control%stda_control%do_ewald = .false.
2442 t_control%stda_control%do_ewald = .true.
2444 t_control%stda_control%do_ewald = .true.
2446 t_control%stda_control%do_ewald = .true.
2448 cpabort(
"Illegal value for periodiciy")
2450 CALL section_vals_get(stda_section, explicit=explicit)
2452 CALL section_vals_val_get(stda_section,
"HFX_FRACTION", r_val=hfx, explicit=expl)
2453 IF (expl) t_control%stda_control%hfx_fraction = hfx
2454 CALL section_vals_val_get(stda_section,
"EPS_TD_FILTER", r_val=filter, explicit=expl)
2455 IF (expl) t_control%stda_control%eps_td_filter = filter
2456 CALL section_vals_val_get(stda_section,
"DO_EWALD", l_val=do_ewald, explicit=expl)
2457 IF (expl) t_control%stda_control%do_ewald = do_ewald
2458 CALL section_vals_val_get(stda_section,
"DO_EXCHANGE", l_val=do_exchange, explicit=expl)
2459 IF (expl) t_control%stda_control%do_exchange = do_exchange
2460 CALL section_vals_val_get(stda_section,
"MATAGA_NISHIMOTO_CEXP", r_val=fval)
2461 t_control%stda_control%mn_alpha = fval
2462 CALL section_vals_val_get(stda_section,
"MATAGA_NISHIMOTO_XEXP", r_val=fval)
2463 t_control%stda_control%mn_beta = fval
2465 CALL section_vals_val_get(stda_section,
"COULOMB_SR_CUT", r_val=fval)
2466 t_control%stda_control%coulomb_sr_cut = fval
2467 CALL section_vals_val_get(stda_section,
"COULOMB_SR_EPS", r_val=fval)
2468 t_control%stda_control%coulomb_sr_eps = fval
2471 CALL timestop(handle)
2480 TYPE(dft_control_type),
POINTER :: dft_control
2481 TYPE(section_vals_type),
POINTER :: dft_section
2483 CHARACTER(len=*),
PARAMETER :: routinen =
'write_dft_control'
2485 CHARACTER(LEN=20) :: tmpstr
2486 INTEGER :: handle, i, i_rep, max_mtlr_iter, n_rep, &
2488 REAL(kind=dp) :: density_cut, density_smooth_cut_range, &
2489 eps_u_j_loop, gradient_cut, tau_cut
2490 TYPE(cp_logger_type),
POINTER :: logger
2491 TYPE(enumeration_type),
POINTER :: enum
2492 TYPE(keyword_type),
POINTER :: keyword
2493 TYPE(section_type),
POINTER :: section
2494 TYPE(section_vals_type),
POINTER :: xc_section
2496 IF (dft_control%qs_control%semi_empirical)
RETURN
2497 IF (dft_control%qs_control%dftb)
RETURN
2498 IF (dft_control%qs_control%xtb)
THEN
2499 CALL write_xtb_control(dft_control%qs_control%xtb_control, dft_section)
2502 CALL timeset(routinen, handle)
2505 logger => cp_get_default_logger()
2507 output_unit = cp_print_key_unit_nr(logger, dft_section, &
2508 "PRINT%DFT_CONTROL_PARAMETERS", extension=
".Log")
2510 IF (output_unit > 0)
THEN
2512 xc_section => section_vals_get_subs_vals(dft_section,
"XC")
2514 IF (dft_control%uks)
THEN
2515 WRITE (unit=output_unit, fmt=
"(/,T2,A,T78,A)") &
2516 "DFT| Spin unrestricted (spin-polarized) Kohn-Sham calculation",
"UKS"
2517 ELSE IF (dft_control%roks)
THEN
2518 WRITE (unit=output_unit, fmt=
"(/,T2,A,T77,A)") &
2519 "DFT| Spin restricted open Kohn-Sham calculation",
"ROKS"
2521 WRITE (unit=output_unit, fmt=
"(/,T2,A,T78,A)") &
2522 "DFT| Spin restricted Kohn-Sham (RKS) calculation",
"RKS"
2525 WRITE (unit=output_unit, fmt=
"(T2,A,T76,I5)") &
2526 "DFT| Multiplicity", dft_control%multiplicity
2527 WRITE (unit=output_unit, fmt=
"(T2,A,T76,I5)") &
2528 "DFT| Number of spin states", dft_control%nspins
2530 WRITE (unit=output_unit, fmt=
"(T2,A,T76,I5)") &
2531 "DFT| Charge", dft_control%charge
2533 IF (dft_control%sic_method_id /= sic_none)
CALL cite_reference(vandevondele2005b)
2534 SELECT CASE (dft_control%sic_method_id)
2537 CASE (sic_mauri_spz)
2538 tmpstr =
"SPZ/MAURI SIC"
2540 tmpstr =
"US/MAURI SIC"
2544 tmpstr =
"Explicit Orbital SIC"
2547 cpabort(
"SIC option unknown")
2550 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2551 "DFT| Self-interaction correction (SIC)", adjustr(trim(tmpstr))
2553 IF (dft_control%sic_method_id /= sic_none)
THEN
2554 WRITE (unit=output_unit, fmt=
"(T2,A,T66,ES15.6)") &
2555 "DFT| SIC scaling parameter a", dft_control%sic_scaling_a, &
2556 "DFT| SIC scaling parameter b", dft_control%sic_scaling_b
2559 IF (dft_control%sic_method_id == sic_eo)
THEN
2560 IF (dft_control%sic_list_id == sic_list_all)
THEN
2561 WRITE (unit=output_unit, fmt=
"(T2,A,T66,A)") &
2562 "DFT| SIC orbitals",
"ALL"
2564 IF (dft_control%sic_list_id == sic_list_unpaired)
THEN
2565 WRITE (unit=output_unit, fmt=
"(T2,A,T66,A)") &
2566 "DFT| SIC orbitals",
"UNPAIRED"
2570 CALL section_vals_val_get(xc_section,
"density_cutoff", r_val=density_cut)
2571 CALL section_vals_val_get(xc_section,
"gradient_cutoff", r_val=gradient_cut)
2572 CALL section_vals_val_get(xc_section,
"tau_cutoff", r_val=tau_cut)
2573 CALL section_vals_val_get(xc_section,
"density_smooth_cutoff_range", r_val=density_smooth_cut_range)
2575 WRITE (unit=output_unit, fmt=
"(T2,A,T66,ES15.6)") &
2576 "DFT| Cutoffs: density ", density_cut, &
2577 "DFT| gradient", gradient_cut, &
2578 "DFT| tau ", tau_cut, &
2579 "DFT| cutoff_smoothing_range", density_smooth_cut_range
2580 CALL section_vals_val_get(xc_section,
"XC_GRID%XC_SMOOTH_RHO", &
2582 WRITE (output_unit,
'( A, T61, A )') &
2583 " DFT| XC density smoothing ", adjustr(tmpstr)
2584 CALL section_vals_val_get(xc_section,
"XC_GRID%XC_DERIV", &
2586 WRITE (output_unit,
'( A, T61, A )') &
2587 " DFT| XC derivatives ", adjustr(tmpstr)
2588 IF (dft_control%dft_plus_u)
THEN
2589 NULLIFY (enum, keyword, section)
2590 CALL create_dft_section(section)
2591 keyword => section_get_keyword(section,
"PLUS_U_METHOD")
2592 CALL keyword_get(keyword, enum=enum)
2593 WRITE (unit=output_unit, fmt=
"(/,T2,A,T41,A40)") &
2594 "DFT+U| Method", adjustr(trim(enum_i2c(enum, dft_control%plus_u_method_id)))
2595 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2596 "DFT+U| Check atomic kind information for details"
2597 IF (dft_control%mtlr_u_j)
THEN
2598 CALL section_vals_val_get(dft_section,
"EPS_U_J_LOOP", r_val=eps_u_j_loop)
2599 WRITE (unit=output_unit, fmt=
"(T2,A,T67,ES14.7E3)") &
2600 "MTLR U J| EPS_U_J_LOOP", eps_u_j_loop
2601 CALL section_vals_val_get(dft_section,
"MAX_MTLR_LOOP", i_val=max_mtlr_iter)
2602 WRITE (unit=output_unit, fmt=
"(T2,A,T67,I10)") &
2603 "MTLR U J| MAX_MTLR_LOOP", max_mtlr_iter
2605 CALL section_release(section)
2608 WRITE (unit=output_unit, fmt=
"(A)")
""
2609 CALL xc_write(output_unit, xc_section, dft_control%lsd)
2611 IF (dft_control%apply_period_efield)
THEN
2612 WRITE (unit=output_unit, fmt=
"(A)")
""
2613 IF (dft_control%period_efield%displacement_field)
THEN
2614 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2615 "PERIODIC_EFIELD| Use displacement field formulation"
2616 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,ES14.6)") &
2617 "PERIODIC_EFIELD| Displacement field filter: x", &
2618 dft_control%period_efield%d_filter(1), &
2619 "PERIODIC_EFIELD| y", &
2620 dft_control%period_efield%d_filter(2), &
2621 "PERIODIC_EFIELD| z", &
2622 dft_control%period_efield%d_filter(3)
2624 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,ES14.6)") &
2625 "PERIODIC_EFIELD| Polarisation vector: x", &
2626 dft_control%period_efield%polarisation(1), &
2627 "PERIODIC_EFIELD| y", &
2628 dft_control%period_efield%polarisation(2), &
2629 "PERIODIC_EFIELD| z", &
2630 dft_control%period_efield%polarisation(3)
2632 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,I14)") &
2633 "PERIODIC_EFIELD| Start Frame:", &
2634 dft_control%period_efield%start_frame, &
2635 "PERIODIC_EFIELD| End Frame:", &
2636 dft_control%period_efield%end_frame
2638 IF (
ALLOCATED(dft_control%period_efield%strength_list))
THEN
2639 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,I14)") &
2640 "PERIODIC_EFIELD| Number of Intensities:", &
2641 SIZE(dft_control%period_efield%strength_list)
2642 WRITE (unit=output_unit, fmt=
"(T2,A,I10,T66,1X,ES14.6)") &
2643 "PERIODIC_EFIELD| Intensity List [a.u.] ", &
2644 1, dft_control%period_efield%strength_list(1)
2645 DO i = 2,
SIZE(dft_control%period_efield%strength_list)
2646 WRITE (unit=output_unit, fmt=
"(T2,A,I10,T66,1X,ES14.6)") &
2647 "PERIODIC_EFIELD| ", &
2648 i, dft_control%period_efield%strength_list(i)
2651 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,ES14.6)") &
2652 "PERIODIC_EFIELD| Intensity [a.u.]:", &
2653 dft_control%period_efield%strength
2656 IF (norm2(dft_control%period_efield%polarisation) < epsilon(0.0_dp))
THEN
2657 cpabort(
"Invalid (too small) polarisation vector specified for PERIODIC_EFIELD")
2661 IF (dft_control%do_sccs)
THEN
2662 WRITE (unit=output_unit, fmt=
"(/,T2,A)") &
2663 "SCCS| Self-consistent continuum solvation model"
2664 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2665 "SCCS| Relative permittivity of the solvent (medium)", &
2666 dft_control%sccs_control%epsilon_solvent, &
2667 "SCCS| Absolute permittivity [a.u.]", &
2668 dft_control%sccs_control%epsilon_solvent/fourpi
2669 SELECT CASE (dft_control%sccs_control%method_id)
2670 CASE (sccs_andreussi)
2671 WRITE (unit=output_unit, fmt=
"(T2,A,/,(T2,A,T61,ES20.6))") &
2672 "SCCS| Dielectric function proposed by Andreussi et al.", &
2673 "SCCS| rho_max", dft_control%sccs_control%rho_max, &
2674 "SCCS| rho_min", dft_control%sccs_control%rho_min
2675 CASE (sccs_fattebert_gygi)
2676 WRITE (unit=output_unit, fmt=
"(T2,A,/,(T2,A,T61,ES20.6))") &
2677 "SCCS| Dielectric function proposed by Fattebert and Gygi", &
2678 "SCCS| beta", dft_control%sccs_control%beta, &
2679 "SCCS| rho_zero", dft_control%sccs_control%rho_zero
2680 CASE (sccs_saa_andreussi)
2681 WRITE (unit=output_unit, fmt=
"(T2,A,/,A,/,(T2,A,T61,ES20.6))") &
2682 "SCCS| Dielectric function of the solvent aware algorithm", &
2683 "SCCS| proposed by Andreussi et al.", &
2684 "SCCS| rho_max", dft_control%sccs_control%rho_max, &
2685 "SCCS| rho_min", dft_control%sccs_control%rho_min, &
2686 "SCCS| f0", dft_control%sccs_control%f0, &
2687 "SCCS| delta_eta", dft_control%sccs_control%delta_eta, &
2688 "SCCS| alpha_zeta", dft_control%sccs_control%alpha_zeta, &
2689 "SCCS| delta_zeta", dft_control%sccs_control%delta_zeta, &
2690 "SCCS| R_solv", dft_control%sccs_control%R_solv
2692 cpabort(
"Invalid SCCS model specified. Please, check your input!")
2694 SELECT CASE (dft_control%sccs_control%derivative_method)
2695 CASE (sccs_derivative_fft)
2696 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2697 "SCCS| Numerical derivative calculation", &
2699 CASE (sccs_derivative_cd3)
2700 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2701 "SCCS| Numerical derivative calculation", &
2702 adjustr(
"3-point stencil central differences")
2703 CASE (sccs_derivative_cd5)
2704 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2705 "SCCS| Numerical derivative calculation", &
2706 adjustr(
"5-point stencil central differences")
2707 CASE (sccs_derivative_cd7)
2708 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2709 "SCCS| Numerical derivative calculation", &
2710 adjustr(
"7-point stencil central differences")
2712 CALL cp_abort(__location__, &
2713 "Invalid derivative method specified for SCCS model. "// &
2714 "Please, check your input!")
2716 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2717 "SCCS| Repulsion parameter alpha [mN/m] = [dyn/cm]", &
2718 cp_unit_from_cp2k(dft_control%sccs_control%alpha_solvent,
"mN/m")
2719 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2720 "SCCS| Dispersion parameter beta [GPa]", &
2721 cp_unit_from_cp2k(dft_control%sccs_control%beta_solvent,
"GPa")
2722 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2723 "SCCS| Surface tension gamma [mN/m] = [dyn/cm]", &
2724 cp_unit_from_cp2k(dft_control%sccs_control%gamma_solvent,
"mN/m")
2725 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2726 "SCCS| Mixing parameter applied during the iteration cycle", &
2727 dft_control%sccs_control%mixing
2728 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2729 "SCCS| Tolerance for the convergence of the SCCS iteration cycle", &
2730 dft_control%sccs_control%eps_sccs
2731 WRITE (unit=output_unit, fmt=
"(T2,A,T61,I20)") &
2732 "SCCS| Maximum number of iteration steps", &
2733 dft_control%sccs_control%max_iter
2734 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2735 "SCCS| SCF convergence threshold for starting the SCCS iteration", &
2736 dft_control%sccs_control%eps_scf
2737 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2738 "SCCS| Numerical increment for the cavity surface calculation", &
2739 dft_control%sccs_control%delta_rho
2742 WRITE (unit=output_unit, fmt=
"(A)")
""
2746 IF (dft_control%hairy_probes .EQV. .true.)
THEN
2747 n_rep =
SIZE(dft_control%probe)
2748 IF (output_unit > 0)
THEN
2750 WRITE (unit=output_unit, fmt=
"(T2,A,I5)") &
2751 "HP | hair probe set", i_rep
2752 WRITE (unit=output_unit, fmt=
"(T2,A,T61,*(I5))") &
2753 "HP| atom indexes", &
2754 (dft_control%probe(i_rep)%atom_ids(i), i=1, dft_control%probe(i_rep)%natoms)
2755 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2756 "HP| potential", dft_control%probe(i_rep)%mu
2757 WRITE (unit=output_unit, fmt=
"(T2,A,T61,F20.2)") &
2758 "HP| temperature", dft_control%probe(i_rep)%T
2759 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2760 "HP| eps_hp", dft_control%probe(i_rep)%eps_hp
2765 CALL cp_print_key_finished_output(output_unit, logger, dft_section, &
2766 "PRINT%DFT_CONTROL_PARAMETERS")
2768 CALL timestop(handle)
2778 TYPE(admm_control_type),
POINTER :: admm_control
2779 TYPE(section_vals_type),
POINTER :: dft_section
2782 TYPE(cp_logger_type),
POINTER :: logger
2785 logger => cp_get_default_logger()
2787 iounit = cp_print_key_unit_nr(logger, dft_section, &
2788 "PRINT%DFT_CONTROL_PARAMETERS", extension=
".Log")
2790 IF (iounit > 0)
THEN
2792 SELECT CASE (admm_control%admm_type)
2794 WRITE (unit=iounit, fmt=
"(/,T2,A,T77,A)")
"ADMM| Specific ADMM type specified",
"NONE"
2796 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMM1"
2798 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMM2"
2800 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMMS"
2802 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMMP"
2804 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMMQ"
2806 cpabort(
"admm_type")
2809 SELECT CASE (admm_control%purification_method)
2810 CASE (do_admm_purify_none)
2811 WRITE (unit=iounit, fmt=
"(T2,A,T77,A)")
"ADMM| Density matrix purification method",
"NONE"
2812 CASE (do_admm_purify_cauchy)
2813 WRITE (unit=iounit, fmt=
"(T2,A,T75,A)")
"ADMM| Density matrix purification method",
"Cauchy"
2814 CASE (do_admm_purify_cauchy_subspace)
2815 WRITE (unit=iounit, fmt=
"(T2,A,T66,A)")
"ADMM| Density matrix purification method",
"Cauchy subspace"
2816 CASE (do_admm_purify_mo_diag)
2817 WRITE (unit=iounit, fmt=
"(T2,A,T63,A)")
"ADMM| Density matrix purification method",
"MO diagonalization"
2818 CASE (do_admm_purify_mo_no_diag)
2819 WRITE (unit=iounit, fmt=
"(T2,A,T71,A)")
"ADMM| Density matrix purification method",
"MO no diag"
2820 CASE (do_admm_purify_mcweeny)
2821 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Density matrix purification method",
"McWeeny"
2822 CASE (do_admm_purify_none_dm)
2823 WRITE (unit=iounit, fmt=
"(T2,A,T73,A)")
"ADMM| Density matrix purification method",
"NONE(DM)"
2825 cpabort(
"admm_purification_method")
2828 SELECT CASE (admm_control%method)
2829 CASE (do_admm_basis_projection)
2830 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Orbital projection on ADMM basis"
2831 CASE (do_admm_blocking_purify_full)
2832 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Blocked Fock matrix projection with full purification"
2833 CASE (do_admm_blocked_projection)
2834 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Blocked Fock matrix projection"
2835 CASE (do_admm_charge_constrained_projection)
2836 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Orbital projection with charge constrain"
2838 cpabort(
"admm method")
2841 SELECT CASE (admm_control%scaling_model)
2842 CASE (do_admm_exch_scaling_none)
2843 CASE (do_admm_exch_scaling_merlot)
2844 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Use Merlot (2014) scaling model"
2846 cpabort(
"admm scaling_model")
2849 WRITE (unit=iounit, fmt=
"(T2,A,T61,G20.10)")
"ADMM| eps_filter", admm_control%eps_filter
2851 SELECT CASE (admm_control%aux_exch_func)
2852 CASE (do_admm_aux_exch_func_none)
2853 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| No exchange functional correction term used"
2854 CASE (do_admm_aux_exch_func_default, do_admm_aux_exch_func_default_libxc)
2855 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Exchange functional in correction term",
"(W)PBEX"
2856 CASE (do_admm_aux_exch_func_pbex, do_admm_aux_exch_func_pbex_libxc)
2857 WRITE (unit=iounit, fmt=
"(T2,A,T77,A)")
"ADMM| Exchange functional in correction term",
"PBEX"
2858 CASE (do_admm_aux_exch_func_opt, do_admm_aux_exch_func_opt_libxc)
2859 WRITE (unit=iounit, fmt=
"(T2,A,T77,A)")
"ADMM| Exchange functional in correction term",
"OPTX"
2860 CASE (do_admm_aux_exch_func_bee, do_admm_aux_exch_func_bee_libxc)
2861 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Exchange functional in correction term",
"Becke88"
2862 CASE (do_admm_aux_exch_func_sx_libxc)
2863 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Exchange functional in correction term",
"SlaterX"
2865 cpabort(
"admm aux_exch_func")
2868 WRITE (unit=iounit, fmt=
"(A)")
""
2872 CALL cp_print_key_finished_output(iounit, logger, dft_section, &
2873 "PRINT%DFT_CONTROL_PARAMETERS")
2881 SUBROUTINE write_xtb_control(xtb_control, dft_section)
2882 TYPE(xtb_control_type),
POINTER :: xtb_control
2883 TYPE(section_vals_type),
POINTER :: dft_section
2885 CHARACTER(len=*),
PARAMETER :: routinen =
'write_xtb_control'
2887 CHARACTER(LEN=16) :: scc_mixer_name, solver_name
2888 INTEGER :: handle, output_unit
2889 TYPE(cp_logger_type),
POINTER :: logger
2891 CALL timeset(routinen, handle)
2893 logger => cp_get_default_logger()
2895 output_unit = cp_print_key_unit_nr(logger, dft_section, &
2896 "PRINT%DFT_CONTROL_PARAMETERS", extension=
".Log")
2898 IF (output_unit > 0)
THEN
2900 WRITE (unit=output_unit, fmt=
"(/,T2,A,T31,A50)") &
2901 "xTB| Parameter file", adjustr(trim(xtb_control%parameter_file_name))
2902 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2903 "xTB| Basis expansion STO-NG", xtb_control%sto_ng
2904 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2905 "xTB| Basis expansion STO-NG for Hydrogen", xtb_control%h_sto_ng
2906 WRITE (unit=output_unit, fmt=
"(T2,A,T71,E10.4)") &
2907 "xTB| Repulsive pair potential accuracy", xtb_control%eps_pair
2908 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.6)") &
2909 "xTB| Repulsive enhancement factor", xtb_control%enscale
2910 WRITE (unit=output_unit, fmt=
"(T2,A,T71,L10)") &
2911 "xTB| Halogen interaction potential", xtb_control%xb_interaction
2912 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2913 "xTB| Halogen interaction potential cutoff radius", xtb_control%xb_radius
2914 WRITE (unit=output_unit, fmt=
"(T2,A,T71,L10)") &
2915 "xTB| Nonbonded interactions", xtb_control%do_nonbonded
2916 SELECT CASE (xtb_control%vdw_type)
2917 CASE (xtb_vdw_type_none)
2918 WRITE (unit=output_unit, fmt=
"(T2,A)")
"xTB| No vdW potential selected"
2919 CASE (xtb_vdw_type_d3)
2920 WRITE (unit=output_unit, fmt=
"(T2,A,T72,A)")
"xTB| vdW potential type:",
"DFTD3(BJ)"
2921 WRITE (unit=output_unit, fmt=
"(T2,A,T31,A50)") &
2922 "xTB| D3 Dispersion: Parameter file", adjustr(trim(xtb_control%dispersion_parameter_file))
2923 CASE (xtb_vdw_type_d4)
2924 WRITE (unit=output_unit, fmt=
"(T2,A,T76,A)")
"xTB| vdW potential type:",
"DFTD4"
2925 WRITE (unit=output_unit, fmt=
"(T2,A,T31,A50)") &
2926 "xTB| D4 Dispersion: Parameter file", adjustr(trim(xtb_control%dispersion_parameter_file))
2930 WRITE (unit=output_unit, fmt=
"(T2,A,T51,3F10.3)") &
2931 "xTB| Huckel constants ks kp kd", xtb_control%ks, xtb_control%kp, xtb_control%kd
2932 WRITE (unit=output_unit, fmt=
"(T2,A,T61,2F10.3)") &
2933 "xTB| Huckel constants ksp k2sh", xtb_control%ksp, xtb_control%k2sh
2934 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2935 "xTB| Mataga-Nishimoto exponent", xtb_control%kg
2936 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2937 "xTB| Repulsion potential exponent", xtb_control%kf
2938 WRITE (unit=output_unit, fmt=
"(T2,A,T51,3F10.3)") &
2939 "xTB| Coordination number scaling kcn(s) kcn(p) kcn(d)", &
2940 xtb_control%kcns, xtb_control%kcnp, xtb_control%kcnd
2941 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2942 "xTB| Electronegativity scaling", xtb_control%ken
2943 WRITE (unit=output_unit, fmt=
"(T2,A,T61,2F10.3)") &
2944 "xTB| Halogen potential scaling kxr kx2", xtb_control%kxr, xtb_control%kx2
2945 SELECT CASE (xtb_control%tblite_scc_mixer)
2946 CASE (tblite_scc_mixer_auto)
2947 scc_mixer_name =
"AUTO"
2948 CASE (tblite_scc_mixer_tblite)
2949 scc_mixer_name =
"TBLITE"
2950 CASE (tblite_scc_mixer_cp2k)
2951 scc_mixer_name =
"CP2K"
2952 CASE (tblite_scc_mixer_none)
2953 scc_mixer_name =
"NONE"
2955 cpabort(
"Unknown tblite SCC mixer")
2957 SELECT CASE (xtb_control%tblite_mixer_solver)
2958 CASE (tblite_solver_gvd)
2960 CASE (tblite_solver_gvr)
2963 cpabort(
"Unknown tblite SCC mixer solver")
2965 WRITE (unit=output_unit, fmt=
"(T2,A,T72,A)") &
2966 "xTB| SCC mixer:", trim(scc_mixer_name)
2967 WRITE (unit=output_unit, fmt=
"(T2,A,T71,ES10.3)") &
2968 "xTB| tblite accuracy:", xtb_control%tblite_accuracy
2969 IF (len_trim(xtb_control%tblite_param_file) > 0)
THEN
2970 WRITE (unit=output_unit, fmt=
"(T2,A,T33,A)") &
2971 "xTB| tblite parameter file:", trim(xtb_control%tblite_param_file)
2973 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2974 "xTB| tblite SCC mixer damping:", xtb_control%tblite_mixer_damping
2975 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2976 "xTB| tblite SCC mixer iterations:", xtb_control%tblite_mixer_iterations
2977 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2978 "xTB| tblite SCC mixer memory:", xtb_control%tblite_mixer_memory
2979 WRITE (unit=output_unit, fmt=
"(T2,A,T72,A)") &
2980 "xTB| tblite SCC mixer solver:", trim(solver_name)
2981 WRITE (unit=output_unit, fmt=
"(T2,A,T71,ES10.3)") &
2982 "xTB| tblite SCC mixer omega0:", xtb_control%tblite_mixer_omega0
2983 WRITE (unit=output_unit, fmt=
"(T2,A,T71,ES10.3)") &
2984 "xTB| tblite SCC mixer min weight:", xtb_control%tblite_mixer_min_weight
2985 WRITE (unit=output_unit, fmt=
"(T2,A,T71,ES10.3)") &
2986 "xTB| tblite SCC mixer max weight:", xtb_control%tblite_mixer_max_weight
2987 WRITE (unit=output_unit, fmt=
"(T2,A,T71,ES10.3)") &
2988 "xTB| tblite SCC mixer weight factor:", xtb_control%tblite_mixer_weight_factor
2989 WRITE (unit=output_unit, fmt=
"(/)")
2993 CALL cp_print_key_finished_output(output_unit, logger, dft_section, &
2994 "PRINT%DFT_CONTROL_PARAMETERS")
2996 CALL timestop(handle)
2998 END SUBROUTINE write_xtb_control
3006 TYPE(qs_control_type),
INTENT(IN) :: qs_control
3007 TYPE(section_vals_type),
POINTER :: dft_section
3009 CHARACTER(len=*),
PARAMETER :: routinen =
'write_qs_control'
3011 CHARACTER(len=20) :: method, quadrature
3012 INTEGER :: handle, i, igrid_level, ngrid_level, &
3014 TYPE(cp_logger_type),
POINTER :: logger
3015 TYPE(ddapc_restraint_type),
POINTER :: ddapc_restraint_control
3016 TYPE(enumeration_type),
POINTER :: enum
3017 TYPE(keyword_type),
POINTER :: keyword
3018 TYPE(section_type),
POINTER :: qs_section
3019 TYPE(section_vals_type),
POINTER :: print_section_vals, qs_section_vals
3021 IF (qs_control%semi_empirical)
RETURN
3022 IF (qs_control%dftb)
RETURN
3023 IF (qs_control%xtb)
RETURN
3024 CALL timeset(routinen, handle)
3025 NULLIFY (logger, print_section_vals, qs_section, qs_section_vals)
3026 logger => cp_get_default_logger()
3027 print_section_vals => section_vals_get_subs_vals(dft_section,
"PRINT")
3028 qs_section_vals => section_vals_get_subs_vals(dft_section,
"QS")
3029 CALL section_vals_get(qs_section_vals, section=qs_section)
3031 NULLIFY (enum, keyword)
3032 keyword => section_get_keyword(qs_section,
"METHOD")
3033 CALL keyword_get(keyword, enum=enum)
3034 method = trim(enum_i2c(enum, qs_control%method_id))
3036 NULLIFY (enum, keyword)
3037 keyword => section_get_keyword(qs_section,
"QUADRATURE")
3038 CALL keyword_get(keyword, enum=enum)
3039 quadrature = trim(enum_i2c(enum, qs_control%gapw_control%quadrature))
3041 output_unit = cp_print_key_unit_nr(logger, print_section_vals, &
3042 "DFT_CONTROL_PARAMETERS", extension=
".Log")
3043 IF (output_unit > 0)
THEN
3044 ngrid_level =
SIZE(qs_control%e_cutoff)
3045 WRITE (unit=output_unit, fmt=
"(/,T2,A,T61,A20)") &
3046 "QS| Method:", adjustr(method)
3047 IF (qs_control%pw_grid_opt%spherical)
THEN
3048 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A)") &
3049 "QS| Density plane wave grid type",
" SPHERICAL HALFSPACE"
3050 ELSE IF (qs_control%pw_grid_opt%fullspace)
THEN
3051 WRITE (unit=output_unit, fmt=
"(T2,A,T57,A)") &
3052 "QS| Density plane wave grid type",
" NON-SPHERICAL FULLSPACE"
3054 WRITE (unit=output_unit, fmt=
"(T2,A,T57,A)") &
3055 "QS| Density plane wave grid type",
" NON-SPHERICAL HALFSPACE"
3057 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
3058 "QS| Number of grid levels:",
SIZE(qs_control%e_cutoff)
3059 IF (ngrid_level == 1)
THEN
3060 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
3061 "QS| Density cutoff [a.u.]:", qs_control%e_cutoff(1)
3063 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
3064 "QS| Density cutoff [a.u.]:", qs_control%cutoff
3065 IF (qs_control%commensurate_mgrids)
THEN
3066 WRITE (unit=output_unit, fmt=
"(T2,A)")
"QS| Using commensurate multigrids"
3068 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
3069 "QS| Multi grid cutoff [a.u.]: 1) grid level", qs_control%e_cutoff(1)
3070 WRITE (unit=output_unit, fmt=
"(T2,A,I3,A,T71,F10.1)") &
3071 (
"QS| ", igrid_level,
") grid level", &
3072 qs_control%e_cutoff(igrid_level), &
3073 igrid_level=2,
SIZE(qs_control%e_cutoff))
3075 IF (qs_control%pao)
THEN
3076 WRITE (unit=output_unit, fmt=
"(T2,A)")
"QS| PAO active"
3078 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
3079 "QS| Grid level progression factor:", qs_control%progression_factor
3080 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
3081 "QS| Relative density cutoff [a.u.]:", qs_control%relative_cutoff
3082 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
3083 "QS| Interaction thresholds: eps_pgf_orb:", &
3084 qs_control%eps_pgf_orb, &
3085 "QS| eps_filter_matrix:", &
3086 qs_control%eps_filter_matrix, &
3087 "QS| eps_core_charge:", &
3088 qs_control%eps_core_charge, &
3089 "QS| eps_rho_gspace:", &
3090 qs_control%eps_rho_gspace, &
3091 "QS| eps_rho_rspace:", &
3092 qs_control%eps_rho_rspace, &
3093 "QS| eps_gvg_rspace:", &
3094 qs_control%eps_gvg_rspace, &
3096 qs_control%eps_ppl, &
3099 IF (qs_control%gapw)
THEN
3100 IF (qs_control%gapw_control%accurate_xcint)
THEN
3101 WRITE (unit=output_unit, fmt=
"(T2,A,T79,I2)") &
3102 "QS| GAPW| XC integration using accurate scheme: Polynomial order (2n) =", &
3103 qs_control%gapw_control%oweights
3104 WRITE (unit=output_unit, fmt=
"(T2,A,T69,F12.6)") &
3105 "QS| GAPW| Ref. exponent =", &
3106 qs_control%gapw_control%aweights
3109 SELECT CASE (qs_control%gapw_control%basis_1c)
3111 WRITE (unit=output_unit, fmt=
"(T2,A)") &
3112 "QS| GAPW| One center basis from orbital basis primitives"
3113 CASE (gapw_1c_small)
3114 WRITE (unit=output_unit, fmt=
"(T2,A)") &
3115 "QS| GAPW| One center basis extended with primitives (small:s)"
3116 CASE (gapw_1c_medium)
3117 WRITE (unit=output_unit, fmt=
"(T2,A)") &
3118 "QS| GAPW| One center basis extended with primitives (medium:sp)"
3119 CASE (gapw_1c_large)
3120 WRITE (unit=output_unit, fmt=
"(T2,A)") &
3121 "QS| GAPW| One center basis extended with primitives (large:spd)"
3122 CASE (gapw_1c_very_large)
3123 WRITE (unit=output_unit, fmt=
"(T2,A)") &
3124 "QS| GAPW| One center basis extended with primitives (very large:spdf)"
3126 cpabort(
"basis_1c incorrect")
3128 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
3129 "QS| GAPW| eps_fit:", &
3130 qs_control%gapw_control%eps_fit, &
3131 "QS| GAPW| eps_iso:", &
3132 qs_control%gapw_control%eps_iso, &
3133 "QS| GAPW| eps_svd:", &
3134 qs_control%gapw_control%eps_svd, &
3135 "QS| GAPW| eps_cpc:", &
3136 qs_control%gapw_control%eps_cpc
3137 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
3138 "QS| GAPW| atom-r-grid: quadrature:", &
3140 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
3141 "QS| GAPW| atom-s-grid: max l :", &
3142 qs_control%gapw_control%lmax_sphere, &
3143 "QS| GAPW| max_l_rho0 :", &
3144 qs_control%gapw_control%lmax_rho0
3145 IF (qs_control%gapw_control%non_paw_atoms)
THEN
3146 WRITE (unit=output_unit, fmt=
"(T2,A)") &
3147 "QS| GAPW| At least one kind is NOT PAW, i.e. it has only soft AO "
3149 IF (qs_control%gapw_control%nopaw_as_gpw)
THEN
3150 WRITE (unit=output_unit, fmt=
"(T2,A)") &
3151 "QS| GAPW| The NOT PAW atoms are treated fully GPW"
3154 IF (qs_control%gapw_xc)
THEN
3155 SELECT CASE (qs_control%gapw_control%basis_1c)
3157 WRITE (unit=output_unit, fmt=
"(T2,A)") &
3158 "QS| GAPW_XC| One center basis from orbital basis primitives"
3159 CASE (gapw_1c_small)
3160 WRITE (unit=output_unit, fmt=
"(T2,A)") &
3161 "QS| GAPW_XC| One center basis extended with primitives (small:s)"
3162 CASE (gapw_1c_medium)
3163 WRITE (unit=output_unit, fmt=
"(T2,A)") &
3164 "QS| GAPW_XC| One center basis extended with primitives (medium:sp)"
3165 CASE (gapw_1c_large)
3166 WRITE (unit=output_unit, fmt=
"(T2,A)") &
3167 "QS| GAPW_XC| One center basis extended with primitives (large:spd)"
3168 CASE (gapw_1c_very_large)
3169 WRITE (unit=output_unit, fmt=
"(T2,A)") &
3170 "QS| GAPW_XC| One center basis extended with primitives (very large:spdf)"
3172 cpabort(
"basis_1c incorrect")
3174 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
3175 "QS| GAPW_XC| eps_fit:", &
3176 qs_control%gapw_control%eps_fit, &
3177 "QS| GAPW_XC| eps_iso:", &
3178 qs_control%gapw_control%eps_iso, &
3179 "QS| GAPW_XC| eps_svd:", &
3180 qs_control%gapw_control%eps_svd
3181 WRITE (unit=output_unit, fmt=
"(T2,A,T55,A30)") &
3182 "QS| GAPW_XC|atom-r-grid: quadrature:", &
3183 enum_i2c(enum, qs_control%gapw_control%quadrature)
3184 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
3185 "QS| GAPW_XC| atom-s-grid: max l :", &
3186 qs_control%gapw_control%lmax_sphere
3188 IF (qs_control%mulliken_restraint)
THEN
3189 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
3190 "QS| Mulliken restraint target", qs_control%mulliken_restraint_control%target
3191 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
3192 "QS| Mulliken restraint strength", qs_control%mulliken_restraint_control%strength
3193 WRITE (unit=output_unit, fmt=
"(T2,A,T73,I8)") &
3194 "QS| Mulliken restraint atoms: ", qs_control%mulliken_restraint_control%natoms
3195 WRITE (unit=output_unit, fmt=
"(5I8)") qs_control%mulliken_restraint_control%atoms
3197 IF (qs_control%ddapc_restraint)
THEN
3198 DO i = 1,
SIZE(qs_control%ddapc_restraint_control)
3199 ddapc_restraint_control => qs_control%ddapc_restraint_control(i)
3200 IF (
SIZE(qs_control%ddapc_restraint_control) > 1)
THEN
3201 WRITE (unit=output_unit, fmt=
"(T2,A,T3,I8)") &
3202 "QS| parameters for DDAPC restraint number", i
3204 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
3205 "QS| ddapc restraint target", ddapc_restraint_control%target
3206 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
3207 "QS| ddapc restraint strength", ddapc_restraint_control%strength
3208 WRITE (unit=output_unit, fmt=
"(T2,A,T73,I8)") &
3209 "QS| ddapc restraint atoms: ", ddapc_restraint_control%natoms
3210 WRITE (unit=output_unit, fmt=
"(5I8)") ddapc_restraint_control%atoms
3211 WRITE (unit=output_unit, fmt=
"(T2,A)")
"Coefficients:"
3212 WRITE (unit=output_unit, fmt=
"(5F6.2)") ddapc_restraint_control%coeff
3213 SELECT CASE (ddapc_restraint_control%functional_form)
3214 CASE (do_ddapc_restraint)
3215 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
3216 "QS| ddapc restraint functional form :",
"RESTRAINT"
3217 CASE (do_ddapc_constraint)
3218 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
3219 "QS| ddapc restraint functional form :",
"CONSTRAINT"
3221 cpabort(
"Unknown ddapc restraint")
3225 IF (qs_control%s2_restraint)
THEN
3226 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
3227 "QS| s2 restraint target", qs_control%s2_restraint_control%target
3228 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
3229 "QS| s2 restraint strength", qs_control%s2_restraint_control%strength
3230 SELECT CASE (qs_control%s2_restraint_control%functional_form)
3231 CASE (do_s2_restraint)
3232 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
3233 "QS| s2 restraint functional form :",
"RESTRAINT"
3234 cpabort(
"Not yet implemented")
3235 CASE (do_s2_constraint)
3236 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
3237 "QS| s2 restraint functional form :",
"CONSTRAINT"
3239 cpabort(
"Unknown ddapc restraint")
3243 CALL cp_print_key_finished_output(output_unit, logger, print_section_vals, &
3244 "DFT_CONTROL_PARAMETERS")
3246 CALL timestop(handle)
3263 TYPE(qs_control_type),
INTENT(INOUT) :: qs_control
3264 TYPE(section_vals_type),
OPTIONAL,
POINTER :: qs_section, ddapc_restraint_section
3266 INTEGER :: i, j, jj, k, n_rep
3267 INTEGER,
DIMENSION(:),
POINTER :: tmplist
3268 REAL(kind=dp),
DIMENSION(:),
POINTER :: rtmplist
3269 TYPE(ddapc_restraint_type),
POINTER :: ddapc_restraint_control
3270 TYPE(section_vals_type),
POINTER :: ddapc_section
3272 IF (
PRESENT(ddapc_restraint_section))
THEN
3273 IF (
ASSOCIATED(qs_control%ddapc_restraint_control))
THEN
3274 IF (
SIZE(qs_control%ddapc_restraint_control) >= 2)
THEN
3275 cpabort(
"ET_COUPLING cannot be used in combination with a normal restraint")
3278 ddapc_section => ddapc_restraint_section
3279 ALLOCATE (qs_control%ddapc_restraint_control(1))
3283 IF (
PRESENT(qs_section))
THEN
3284 NULLIFY (ddapc_section)
3285 ddapc_section => section_vals_get_subs_vals(qs_section, &
3289 DO i = 1,
SIZE(qs_control%ddapc_restraint_control)
3291 CALL ddapc_control_create(qs_control%ddapc_restraint_control(i))
3292 ddapc_restraint_control => qs_control%ddapc_restraint_control(i)
3294 CALL section_vals_val_get(ddapc_section,
"STRENGTH", i_rep_section=i, &
3295 r_val=ddapc_restraint_control%strength)
3296 CALL section_vals_val_get(ddapc_section,
"TARGET", i_rep_section=i, &
3297 r_val=ddapc_restraint_control%target)
3298 CALL section_vals_val_get(ddapc_section,
"FUNCTIONAL_FORM", i_rep_section=i, &
3299 i_val=ddapc_restraint_control%functional_form)
3300 CALL section_vals_val_get(ddapc_section,
"ATOMS", i_rep_section=i, &
3302 CALL section_vals_val_get(ddapc_section,
"TYPE_OF_DENSITY", i_rep_section=i, &
3303 i_val=ddapc_restraint_control%density_type)
3307 CALL section_vals_val_get(ddapc_section,
"ATOMS", i_rep_section=i, &
3308 i_rep_val=k, i_vals=tmplist)
3309 DO j = 1,
SIZE(tmplist)
3313 IF (jj < 1) cpabort(
"Need at least 1 atom to use ddapc constraints")
3314 ddapc_restraint_control%natoms = jj
3315 IF (
ASSOCIATED(ddapc_restraint_control%atoms))
THEN
3316 DEALLOCATE (ddapc_restraint_control%atoms)
3318 ALLOCATE (ddapc_restraint_control%atoms(ddapc_restraint_control%natoms))
3321 CALL section_vals_val_get(ddapc_section,
"ATOMS", i_rep_section=i, &
3322 i_rep_val=k, i_vals=tmplist)
3323 DO j = 1,
SIZE(tmplist)
3325 ddapc_restraint_control%atoms(jj) = tmplist(j)
3329 IF (
ASSOCIATED(ddapc_restraint_control%coeff))
THEN
3330 DEALLOCATE (ddapc_restraint_control%coeff)
3332 ALLOCATE (ddapc_restraint_control%coeff(ddapc_restraint_control%natoms))
3333 ddapc_restraint_control%coeff = 1.0_dp
3335 CALL section_vals_val_get(ddapc_section,
"COEFF", i_rep_section=i, &
3339 CALL section_vals_val_get(ddapc_section,
"COEFF", i_rep_section=i, &
3340 i_rep_val=k, r_vals=rtmplist)
3341 DO j = 1,
SIZE(rtmplist)
3343 IF (jj > ddapc_restraint_control%natoms)
THEN
3344 cpabort(
"Need the same number of coeff as there are atoms ")
3346 ddapc_restraint_control%coeff(jj) = rtmplist(j)
3349 IF (jj < ddapc_restraint_control%natoms .AND. jj /= 0)
THEN
3350 cpabort(
"Need no or the same number of coeff as there are atoms.")
3354 DO i = 1,
SIZE(qs_control%ddapc_restraint_control)
3355 IF (qs_control%ddapc_restraint_control(i)%functional_form == &
3356 do_ddapc_constraint) k = k + 1
3358 IF (k == 2)
CALL cp_abort(__location__, &
3359 "Only a single constraint possible yet, try to use restraints instead ")
3369 SUBROUTINE read_efield_sections(dft_control, efield_section, cell)
3370 TYPE(dft_control_type),
POINTER :: dft_control
3371 TYPE(section_vals_type),
POINTER :: efield_section
3372 TYPE(cell_type),
OPTIONAL,
POINTER :: cell
3374 CHARACTER(len=default_path_length) :: file_name
3375 INTEGER :: i, io, j, n, unit_nr
3376 LOGICAL :: amplitude_explicit, intensity_explicit
3377 REAL(kind=dp),
DIMENSION(:),
POINTER :: tmp_vals
3378 TYPE(efield_type),
POINTER :: efield
3379 TYPE(section_vals_type),
POINTER :: tmp_section
3381 DO i = 1,
SIZE(dft_control%efield_fields)
3382 NULLIFY (dft_control%efield_fields(i)%efield)
3383 ALLOCATE (dft_control%efield_fields(i)%efield)
3384 efield => dft_control%efield_fields(i)%efield
3385 NULLIFY (efield%envelop_i_vars, efield%envelop_r_vars)
3386 CALL section_vals_val_get(efield_section,
"INTENSITY", i_rep_section=i, &
3387 r_val=efield%strength, explicit=intensity_explicit)
3388 CALL section_vals_val_get(efield_section,
"AMPLITUDE", i_rep_section=i, &
3389 r_val=efield%amplitude, explicit=amplitude_explicit)
3391 IF (intensity_explicit .AND. amplitude_explicit)
THEN
3392 cpabort(
"Both INTENSITY and AMPLITUDE provided in EFIELD section.")
3395 IF (intensity_explicit)
THEN
3396 efield%amplitude = sqrt(efield%strength/(3.50944_dp*10.0_dp**16))
3399 IF (amplitude_explicit)
THEN
3400 efield%strength = (3.50944_dp*10.0_dp**16)*(efield%amplitude)**2
3403 CALL section_vals_val_get(efield_section,
"POLARISATION", i_rep_section=i, &
3405 ALLOCATE (efield%polarisation(
SIZE(tmp_vals)))
3406 efield%polarisation = tmp_vals
3407 IF (
PRESENT(cell))
THEN
3408 IF (
ASSOCIATED(cell))
CALL cell_transform_input_cartesian(cell, efield%polarisation(1:3))
3410 CALL section_vals_val_get(efield_section,
"PHASE", i_rep_section=i, &
3411 r_val=efield%phase_offset)
3412 CALL section_vals_val_get(efield_section,
"ENVELOP", i_rep_section=i, &
3413 i_val=efield%envelop_id)
3414 CALL section_vals_val_get(efield_section,
"WAVELENGTH", i_rep_section=i, &
3415 r_val=efield%wavelength)
3416 CALL section_vals_val_get(efield_section,
"VEC_POT_INITIAL", i_rep_section=i, &
3418 efield%vec_pot_initial = tmp_vals
3419 IF (
PRESENT(cell))
THEN
3420 IF (
ASSOCIATED(cell))
CALL cell_transform_input_cartesian(cell, efield%vec_pot_initial(1:3))
3423 IF (efield%envelop_id == constant_env)
THEN
3424 ALLOCATE (efield%envelop_i_vars(2))
3425 tmp_section => section_vals_get_subs_vals(efield_section,
"CONSTANT_ENV", i_rep_section=i)
3426 CALL section_vals_val_get(tmp_section,
"START_STEP", &
3427 i_val=efield%envelop_i_vars(1))
3428 CALL section_vals_val_get(tmp_section,
"END_STEP", &
3429 i_val=efield%envelop_i_vars(2))
3430 ELSE IF (efield%envelop_id == gaussian_env)
THEN
3431 ALLOCATE (efield%envelop_r_vars(2))
3432 tmp_section => section_vals_get_subs_vals(efield_section,
"GAUSSIAN_ENV", i_rep_section=i)
3433 CALL section_vals_val_get(tmp_section,
"T0", &
3434 r_val=efield%envelop_r_vars(1))
3435 CALL section_vals_val_get(tmp_section,
"SIGMA", &
3436 r_val=efield%envelop_r_vars(2))
3437 ELSE IF (efield%envelop_id == ramp_env)
THEN
3438 ALLOCATE (efield%envelop_i_vars(4))
3439 tmp_section => section_vals_get_subs_vals(efield_section,
"RAMP_ENV", i_rep_section=i)
3440 CALL section_vals_val_get(tmp_section,
"START_STEP_IN", &
3441 i_val=efield%envelop_i_vars(1))
3442 CALL section_vals_val_get(tmp_section,
"END_STEP_IN", &
3443 i_val=efield%envelop_i_vars(2))
3444 CALL section_vals_val_get(tmp_section,
"START_STEP_OUT", &
3445 i_val=efield%envelop_i_vars(3))
3446 CALL section_vals_val_get(tmp_section,
"END_STEP_OUT", &
3447 i_val=efield%envelop_i_vars(4))
3448 ELSE IF (efield%envelop_id == custom_env)
THEN
3449 tmp_section => section_vals_get_subs_vals(efield_section,
"CUSTOM_ENV", i_rep_section=i)
3450 CALL section_vals_val_get(tmp_section,
"EFIELD_FILE_NAME", c_val=file_name)
3451 CALL open_file(file_name=trim(file_name), file_action=
"READ", file_status=
"OLD", unit_number=unit_nr)
3455 READ (unit_nr, *, iostat=io)
3460 ALLOCATE (efield%envelop_r_vars(n + 1))
3462 CALL section_vals_val_get(tmp_section,
"TIMESTEP", r_val=efield%envelop_r_vars(1))
3465 READ (unit_nr, *) efield%envelop_r_vars(j)
3466 efield%envelop_r_vars(j) = cp_unit_to_cp2k(efield%envelop_r_vars(j),
"volt/m")
3468 CALL close_file(unit_nr)
3471 END SUBROUTINE read_efield_sections
3479 SUBROUTINE read_rtp_section(dft_control, rtp_section)
3481 TYPE(dft_control_type),
INTENT(INOUT) :: dft_control
3482 TYPE(section_vals_type),
POINTER :: rtp_section
3484 INTEGER :: i, j, n_elems
3485 INTEGER,
DIMENSION(:),
POINTER :: tmp
3486 LOGICAL :: is_present, linearize_bse_propagation, &
3487 local_moment_possible
3488 TYPE(section_vals_type),
POINTER :: proj_mo_section, subsection
3490 ALLOCATE (dft_control%rtp_control)
3491 CALL section_vals_val_get(rtp_section,
"MAX_ITER", &
3492 i_val=dft_control%rtp_control%max_iter)
3493 CALL section_vals_val_get(rtp_section,
"MAT_EXP", &
3494 i_val=dft_control%rtp_control%mat_exp)
3495 CALL section_vals_val_get(rtp_section,
"ASPC_ORDER", &
3496 i_val=dft_control%rtp_control%aspc_order)
3497 CALL section_vals_val_get(rtp_section,
"EXP_ACCURACY", &
3498 r_val=dft_control%rtp_control%eps_exp)
3499 CALL section_vals_val_get(rtp_section,
"RTBSE%_SECTION_PARAMETERS_", &
3500 i_val=dft_control%rtp_control%rtp_method)
3501 CALL section_vals_val_get(rtp_section,
"RTBSE%RTBSE_HAMILTONIAN", &
3502 i_val=dft_control%rtp_control%rtbse_ham)
3503 CALL section_vals_val_get(rtp_section,
"RTBSE%LINEARIZED_BSE_PROPAGATION", &
3504 l_val=linearize_bse_propagation)
3508 IF (linearize_bse_propagation)
THEN
3509 IF (dft_control%rtp_control%rtp_method /= rtp_method_bse)
THEN
3510 CALL cp_abort(__location__, &
3511 "LINEARIZED_BSE_PROPAGATION requires the RTBSE section opened as "// &
3512 "'&RTBSE' or '&RTBSE RTBSE', not '&RTBSE TDDFT'.")
3514 dft_control%rtp_control%rtp_method = rtp_method_bse_linearized
3517 CALL section_vals_val_get(rtp_section,
"PROPAGATOR", &
3518 i_val=dft_control%rtp_control%propagator)
3519 CALL section_vals_val_get(rtp_section,
"EPS_ITER", &
3520 r_val=dft_control%rtp_control%eps_ener)
3521 CALL section_vals_val_get(rtp_section,
"INITIAL_WFN", &
3522 i_val=dft_control%rtp_control%initial_wfn)
3523 CALL section_vals_val_get(rtp_section,
"HFX_BALANCE_IN_CORE", &
3524 l_val=dft_control%rtp_control%hfx_redistribute)
3525 CALL section_vals_val_get(rtp_section,
"APPLY_WFN_MIX_INIT_RESTART", &
3526 l_val=dft_control%rtp_control%apply_wfn_mix_init_restart)
3527 CALL section_vals_val_get(rtp_section,
"APPLY_DELTA_PULSE", &
3528 l_val=dft_control%rtp_control%apply_delta_pulse)
3529 CALL section_vals_val_get(rtp_section,
"APPLY_DELTA_PULSE_MAG", &
3530 l_val=dft_control%rtp_control%apply_delta_pulse_mag)
3531 CALL section_vals_val_get(rtp_section,
"VELOCITY_GAUGE", &
3532 l_val=dft_control%rtp_control%velocity_gauge)
3533 CALL section_vals_val_get(rtp_section,
"VG_COM_NL", &
3534 l_val=dft_control%rtp_control%nl_gauge_transform)
3535 CALL section_vals_val_get(rtp_section,
"PERIODIC", &
3536 l_val=dft_control%rtp_control%periodic)
3537 CALL section_vals_val_get(rtp_section,
"DENSITY_PROPAGATION", &
3538 l_val=dft_control%rtp_control%linear_scaling)
3539 CALL section_vals_val_get(rtp_section,
"MCWEENY_MAX_ITER", &
3540 i_val=dft_control%rtp_control%mcweeny_max_iter)
3541 CALL section_vals_val_get(rtp_section,
"ACCURACY_REFINEMENT", &
3542 i_val=dft_control%rtp_control%acc_ref)
3543 CALL section_vals_val_get(rtp_section,
"MCWEENY_EPS", &
3544 r_val=dft_control%rtp_control%mcweeny_eps)
3545 CALL section_vals_val_get(rtp_section,
"DELTA_PULSE_SCALE", &
3546 r_val=dft_control%rtp_control%delta_pulse_scale)
3547 CALL section_vals_val_get(rtp_section,
"DELTA_PULSE_DIRECTION", &
3549 dft_control%rtp_control%delta_pulse_direction = tmp
3550 CALL section_vals_val_get(rtp_section,
"SC_CHECK_START", &
3551 i_val=dft_control%rtp_control%sc_check_start)
3552 proj_mo_section => section_vals_get_subs_vals(rtp_section,
"PRINT%PROJECTION_MO")
3553 CALL section_vals_get(proj_mo_section, explicit=is_present)
3554 IF (is_present)
THEN
3555 IF (dft_control%rtp_control%linear_scaling)
THEN
3556 CALL cp_abort(__location__, &
3557 "You have defined a time dependent projection of mos, but "// &
3558 "only the density matrix is propagated (DENSITY_PROPAGATION "// &
3559 ".TRUE.). Please either use MO-based real time DFT or do not "// &
3560 "define any PRINT%PROJECTION_MO section")
3562 dft_control%rtp_control%is_proj_mo = .true.
3564 dft_control%rtp_control%is_proj_mo = .false.
3567 local_moment_possible = (dft_control%rtp_control%rtp_method == rtp_method_bse .OR. &
3568 dft_control%rtp_control%rtp_method == rtp_method_bse_linearized) .OR. &
3569 ((.NOT. dft_control%rtp_control%periodic) .AND. dft_control%rtp_control%linear_scaling)
3571 subsection => section_vals_get_subs_vals(rtp_section,
"PRINT%MOMENTS")
3572 CALL section_vals_get(subsection, explicit=is_present)
3574 dft_control%rtp_control%save_local_moments = &
3575 is_present .OR. dft_control%rtp_control%save_local_moments
3576 IF (is_present .AND. (.NOT. local_moment_possible))
THEN
3577 CALL cp_abort(__location__,
"Moments trace printing only "// &
3578 "implemented in non-periodic systems in linear scaling. "// &
3579 "Please use DFT%PRINT%MOMENTS for other printing.")
3581 CALL section_vals_val_get(rtp_section,
"PRINT%MOMENTS%REFERENCE", &
3582 i_val=dft_control%rtp_control%moment_trace_ref_type)
3583 CALL section_vals_val_get(rtp_section,
"PRINT%MOMENTS%REFERENCE_POINT", &
3584 r_vals=dft_control%rtp_control%moment_trace_user_ref_point)
3586 subsection => section_vals_get_subs_vals(rtp_section,
"PRINT%MOMENTS_FT")
3587 CALL section_vals_get(subsection, explicit=is_present)
3589 dft_control%rtp_control%save_local_moments = &
3590 is_present .OR. dft_control%rtp_control%save_local_moments
3591 IF (is_present .AND. (.NOT. local_moment_possible))
THEN
3593 CALL cp_abort(__location__,
"Moments Fourier transform printing "// &
3594 "implemented only for non-periodic systems in linear scaling.")
3597 CALL section_vals_val_get(rtp_section,
"FT%DAMPING", &
3598 r_val=dft_control%rtp_control%ft_damping)
3599 CALL section_vals_val_get(rtp_section,
"FT%START_TIME", &
3600 r_val=dft_control%rtp_control%ft_t0)
3602 subsection => section_vals_get_subs_vals(rtp_section,
"FT%PADE")
3603 CALL section_vals_val_get(subsection,
"_SECTION_PARAMETERS_", &
3604 l_val=dft_control%rtp_control%pade_requested)
3605 CALL section_vals_val_get(subsection,
"E_MIN", &
3606 r_val=dft_control%rtp_control%pade_e_min)
3607 CALL section_vals_val_get(subsection,
"E_STEP", &
3608 r_val=dft_control%rtp_control%pade_e_step)
3609 CALL section_vals_val_get(subsection,
"E_MAX", &
3610 r_val=dft_control%rtp_control%pade_e_max)
3611 CALL section_vals_val_get(subsection,
"FIT_E_MIN", &
3612 r_val=dft_control%rtp_control%pade_fit_e_min)
3613 CALL section_vals_val_get(subsection,
"FIT_E_MAX", &
3614 r_val=dft_control%rtp_control%pade_fit_e_max)
3616 IF (dft_control%rtp_control%pade_fit_e_min < 0)
THEN
3617 dft_control%rtp_control%pade_fit_e_min = dft_control%rtp_control%pade_e_min
3619 IF (dft_control%rtp_control%pade_fit_e_max < 0)
THEN
3620 dft_control%rtp_control%pade_fit_e_max = dft_control%rtp_control%pade_e_max
3623 subsection => section_vals_get_subs_vals(rtp_section,
"PRINT%POLARIZABILITY")
3624 CALL section_vals_get(subsection, explicit=is_present)
3626 dft_control%rtp_control%save_local_moments = &
3627 is_present .OR. dft_control%rtp_control%save_local_moments
3628 IF (is_present .AND. (.NOT. local_moment_possible))
THEN
3630 CALL cp_abort(__location__,
"Polarizability printing "// &
3631 "implemented only for non-periodic systems.")
3633 CALL section_vals_val_get(subsection,
"ELEMENT", explicit=is_present, n_rep_val=n_elems)
3634 NULLIFY (dft_control%rtp_control%print_pol_elements)
3635 IF (is_present)
THEN
3638 ALLOCATE (dft_control%rtp_control%print_pol_elements(n_elems, 2))
3640 CALL section_vals_val_get(subsection,
"ELEMENT", i_vals=tmp, i_rep_val=i)
3641 dft_control%rtp_control%print_pol_elements(i, :) = tmp(:)
3646 IF (dft_control%rtp_control%print_pol_elements(i, j) > 3 .OR. &
3647 dft_control%rtp_control%print_pol_elements(i, j) < 1)
THEN
3648 cpabort(
"Polarisation tensor element not 1,2 or 3 in at least one index")
3656 dft_control%rtp_control%save_local_moments = &
3657 dft_control%rtp_control%save_local_moments .OR. &
3658 ((.NOT. dft_control%rtp_control%periodic) .AND. dft_control%rtp_control%linear_scaling)
3660 END SUBROUTINE read_rtp_section
3668 SUBROUTINE guess_pol_elements(dftc, elems)
3669 TYPE(dft_control_type) :: dftc
3670 INTEGER,
DIMENSION(:, :),
POINTER :: elems
3672 INTEGER :: i, i_nonzero, n_nonzero
3673 LOGICAL :: pol_vector_known
3674 REAL(kind=dp),
DIMENSION(3) :: pol_vector
3676 pol_vector_known = .false.
3679 IF (dftc%rtp_control%apply_delta_pulse .OR. dftc%rtp_control%apply_delta_pulse_mag)
THEN
3680 pol_vector(:) = real(dftc%rtp_control%delta_pulse_direction(:), kind=dp)
3683 pol_vector(:) = dftc%efield_fields(1)%efield%polarisation(:)
3685 IF (dot_product(pol_vector, pol_vector) > 0.0_dp) pol_vector_known = .true.
3687 IF (.NOT. pol_vector_known)
THEN
3688 cpabort(
"Cannot guess polarization elements - please specify!")
3693 IF (pol_vector(i) /= 0.0_dp)
THEN
3694 n_nonzero = n_nonzero + 1
3698 IF (n_nonzero > 1)
THEN
3699 CALL cp_abort(__location__, &
3700 "More than one non-zero field elements - "// &
3701 "cannot guess polarizability elements - please specify!")
3702 ELSE IF (n_nonzero == 0)
THEN
3703 CALL cp_abort(__location__, &
3704 "No non-zero field elements - "// &
3705 "cannot guess polarizability elements - please specify!")
3709 ALLOCATE (elems(3, 2))
3712 elems(i, 2) = i_nonzero
3716 END SUBROUTINE guess_pol_elements
3723 SUBROUTINE read_admm_block_list(admm_control, dft_section)
3724 TYPE(admm_control_type),
POINTER :: admm_control
3725 TYPE(section_vals_type),
POINTER :: dft_section
3727 INTEGER :: irep, list_size, n_rep
3728 INTEGER,
DIMENSION(:),
POINTER :: tmplist
3732 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%BLOCK_LIST", &
3735 ALLOCATE (admm_control%blocks(n_rep))
3738 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%BLOCK_LIST", &
3739 i_rep_val=irep, i_vals=tmplist)
3740 list_size =
SIZE(tmplist)
3741 ALLOCATE (admm_control%blocks(irep)%list(list_size))
3742 admm_control%blocks(irep)%list(:) = tmplist(:)
3745 END SUBROUTINE read_admm_block_list
3754 SUBROUTINE read_hairy_probes_sections(dft_control, hairy_probes_section)
3755 TYPE(dft_control_type),
POINTER :: dft_control
3756 TYPE(section_vals_type),
POINTER :: hairy_probes_section
3758 INTEGER :: i, j, jj, kk, n_rep
3759 INTEGER,
DIMENSION(:),
POINTER :: tmplist
3761 DO i = 1,
SIZE(dft_control%probe)
3762 NULLIFY (dft_control%probe(i)%atom_ids)
3764 CALL section_vals_val_get(hairy_probes_section,
"ATOM_IDS", i_rep_section=i, n_rep_val=n_rep)
3767 CALL section_vals_val_get(hairy_probes_section,
"ATOM_IDS", i_rep_section=i, i_rep_val=kk, i_vals=tmplist)
3768 jj = jj +
SIZE(tmplist)
3771 dft_control%probe(i)%natoms = jj
3772 IF (dft_control%probe(i)%natoms < 1)
THEN
3773 cpabort(
"Need at least 1 atom to use hair probes formalism")
3775 ALLOCATE (dft_control%probe(i)%atom_ids(dft_control%probe(i)%natoms))
3779 CALL section_vals_val_get(hairy_probes_section,
"ATOM_IDS", i_rep_section=i, i_rep_val=kk, i_vals=tmplist)
3780 DO j = 1,
SIZE(tmplist)
3782 dft_control%probe(i)%atom_ids(jj) = tmplist(j)
3786 CALL section_vals_val_get(hairy_probes_section,
"MU", i_rep_section=i, r_val=dft_control%probe(i)%mu)
3788 CALL section_vals_val_get(hairy_probes_section,
"T", i_rep_section=i, r_val=dft_control%probe(i)%T)
3790 CALL section_vals_val_get(hairy_probes_section,
"ALPHA", i_rep_section=i, r_val=dft_control%probe(i)%alpha)
3792 CALL section_vals_val_get(hairy_probes_section,
"eps_hp", i_rep_section=i, r_val=dft_control%probe(i)%eps_hp)
3795 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.
subroutine, public open_file(file_name, unit_number, file_status, file_form, file_action, file_position, file_pad, file_access, debug)
Opens a file and returns its logical unit number.
subroutine, public close_file(unit_number, file_status)
Closes an open file given by its logical unit number.
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...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout, file_access)
...
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.
Optional native tblite command-line diagnostics.
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...