85#include "./base/base_uses.f90"
91 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'cp_control_utils'
113 CHARACTER(len=default_path_length) :: basis_set_file_name, &
114 intensities_file_name, &
116 CHARACTER(LEN=default_string_length), &
117 DIMENSION(:),
POINTER :: tmpstringlist
118 INTEGER :: admmtype, irep, isize, method_id, nrep, &
120 LOGICAL :: at_end, do_hfx, do_ot, do_rpa_admm, &
121 do_rtp, exopt1, exopt2, exopt3, &
122 explicit, is_present, l_param, not_se, &
124 REAL(kind=
dp) :: density_cut, gradient_cut, tau_cut
125 REAL(kind=
dp),
DIMENSION(:),
POINTER :: pol
128 TYPE(
section_vals_type),
POINTER :: hairy_probes_section, hfx_section, maxwell_section, &
129 sccs_section, scf_section, tmp_section, xc_fun_section, xc_section
131 was_present = .false.
135 NULLIFY (tmp_section, xc_fun_section, xc_section)
136 ALLOCATE (dft_control)
142 SELECT CASE (method_id)
150 IF (.NOT. is_present .AND. not_se)
THEN
151 cpabort(
"XC section missing.")
158 IF (density_cut <= epsilon(0.0_dp)*100.0_dp) &
159 CALL cp_warn(__location__, &
160 "DENSITY_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
161 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
162 density_cut = max(epsilon(0.0_dp)*100.0_dp, density_cut)
163 IF (gradient_cut <= epsilon(0.0_dp)*100.0_dp) &
164 CALL cp_warn(__location__, &
165 "GRADIENT_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
166 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
167 gradient_cut = max(epsilon(0.0_dp)*100.0_dp, gradient_cut)
168 IF (tau_cut <= epsilon(0.0_dp)*100.0_dp) &
169 CALL cp_warn(__location__, &
170 "TAU_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
171 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
172 tau_cut = max(epsilon(0.0_dp)*100.0_dp, tau_cut)
179 IF (.NOT. is_present .AND. not_se)
THEN
180 cpabort(
"XC_FUNCTIONAL section missing.")
185 IF (dft_control%uks .OR. dft_control%roks)
THEN
186 dft_control%nspins = 2
188 dft_control%nspins = 1
191 dft_control%lsd = (dft_control%nspins > 1)
195 dft_control%drho_by_collocation = (
xc_uses_norm_drho(xc_fun_section, dft_control%lsd) &
197 IF (dft_control%drho_by_collocation)
THEN
198 cpabort(
"derivatives by collocation not implemented")
205 IF (
SIZE(tmpstringlist) == 2)
THEN
207 SELECT CASE (tmpstringlist(2))
219 cpwarn(
"Unknown basis size in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
222 SELECT CASE (tmpstringlist(1))
225 dft_control%auto_basis_ri_aux = isize
227 dft_control%auto_basis_aux_fit = isize
229 dft_control%auto_basis_lri_aux = isize
231 dft_control%auto_basis_p_lri_aux = isize
233 dft_control%auto_basis_ri_hxc = isize
235 dft_control%auto_basis_ri_xas = isize
237 dft_control%auto_basis_ri_hfx = isize
239 cpwarn(
"Unknown basis type in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
242 CALL cp_abort(__location__, &
243 "AUTO_BASIS keyword in &DFT section has a wrong number of arguments.")
254 is_present = is_present .AND. (do_hfx .OR. do_rpa_admm)
256 dft_control%do_admm = is_present
257 dft_control%do_admm_mo = .false.
258 dft_control%do_admm_dm = .false.
264 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_TYPE", i_val=admmtype)
265 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", explicit=exopt1)
266 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%METHOD", explicit=exopt2)
267 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_SCALING_MODEL", explicit=exopt3)
268 dft_control%admm_control%admm_type = admmtype
269 SELECT CASE (admmtype)
271 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", i_val=method_id)
272 dft_control%admm_control%purification_method = method_id
273 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%METHOD", i_val=method_id)
274 dft_control%admm_control%method = method_id
275 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_SCALING_MODEL", i_val=method_id)
276 dft_control%admm_control%scaling_model = method_id
281 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", i_val=method_id)
282 dft_control%admm_control%purification_method = method_id
314 CALL cp_abort(__location__, &
315 "ADMM_TYPE keyword in &AUXILIARY_DENSITY_MATRIX_METHOD section has a wrong value.")
319 r_val=dft_control%admm_control%eps_filter)
321 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_CORRECTION_FUNC", i_val=method_id)
322 dft_control%admm_control%aux_exch_func = method_id
325 dft_control%admm_control%aux_exch_func_param = .false.
326 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_A1", explicit=explicit, &
327 r_val=dft_control%admm_control%aux_x_param(1))
328 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
329 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_A2", explicit=explicit, &
330 r_val=dft_control%admm_control%aux_x_param(2))
331 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
332 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_GAMMA", explicit=explicit, &
333 r_val=dft_control%admm_control%aux_x_param(3))
334 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
336 CALL read_admm_block_list(dft_control%admm_control, dft_section)
339 SELECT CASE (admmtype)
341 IF (exopt2)
CALL cp_warn(__location__, &
342 "Value of ADMM_PURIFICATION_METHOD keyword will be overwritten with ADMM_TYPE selections.")
343 IF (exopt3)
CALL cp_warn(__location__, &
344 "Value of EXCH_SCALING_MODEL keyword will be overwritten with ADMM_TYPE selections.")
346 IF (exopt1)
CALL cp_warn(__location__, &
347 "Value of METHOD keyword will be overwritten with ADMM_TYPE selections.")
348 IF (exopt2)
CALL cp_warn(__location__, &
349 "Value of METHOD keyword will be overwritten with ADMM_TYPE selections.")
350 IF (exopt3)
CALL cp_warn(__location__, &
351 "Value of EXCH_SCALING_MODEL keyword will be overwritten with ADMM_TYPE selections.")
360 cpabort(
"ADMM: Blocking and Merlot scaling are mutually exclusive.")
365 CALL cp_abort(__location__, &
366 "ADMM: In the case of METHOD=CHARGE_CONSTRAINED_PROJECTION, "// &
367 "ADMM_PURIFICATION_METHOD=NONE has to be set.")
373 cpabort(
"ADMM: Chosen purification requires BASIS_PROJECTION")
375 IF (.NOT. do_ot) cpabort(
"ADMM: MO-based purification requires OT.")
380 dft_control%do_admm_dm = .true.
382 dft_control%do_admm_mo = .true.
390 dft_control%restricted = (dft_control%roks .AND. l_param)
394 CALL section_vals_val_get(dft_section,
"RELAX_MULTIPLICITY", r_val=dft_control%relax_multiplicity)
395 IF (dft_control%relax_multiplicity > 0.0_dp)
THEN
396 IF (.NOT. dft_control%uks) &
397 CALL cp_abort(__location__,
"The option RELAX_MULTIPLICITY is only valid for "// &
398 "unrestricted Kohn-Sham (UKS) calculations")
403 CALL section_vals_get(hairy_probes_section, n_repetition=nrep, explicit=is_present)
406 dft_control%hairy_probes = .true.
407 ALLOCATE (dft_control%probe(nrep))
408 CALL read_hairy_probes_sections(dft_control, hairy_probes_section)
415 dft_control%sic_method_id =
sic_none
416 dft_control%sic_scaling_a = 1.0_dp
417 dft_control%sic_scaling_b = 1.0_dp
420 dft_control%dft_plus_u = .false.
422 dft_control%plus_u_method_id = method_id
425 dft_control%smear = .false.
428 dft_control%correct_surf_dip = .false.
429 CALL section_vals_val_get(dft_section,
"SURFACE_DIPOLE_CORRECTION", l_val=dft_control%correct_surf_dip)
431 dft_control%pos_dir_surf_dip = -1.0_dp
435 dft_control%switch_surf_dip = .false.
436 dft_control%surf_dip_correct_switch = dft_control%correct_surf_dip
438 dft_control%correct_el_density_dip = .false.
439 CALL section_vals_val_get(dft_section,
"CORE_CORR_DIP", l_val=dft_control%correct_el_density_dip)
440 IF (dft_control%correct_el_density_dip)
THEN
441 IF (dft_control%correct_surf_dip)
THEN
444 dft_control%correct_el_density_dip = .false.
445 cpwarn(
"CORE_CORR_DIP keyword is activated only if SURFACE_DIPOLE_CORRECTION is TRUE")
450 c_val=basis_set_file_name)
452 c_val=potential_file_name)
457 i_val=dft_control%sic_method_id)
459 i_val=dft_control%sic_list_id)
461 r_val=dft_control%sic_scaling_a)
463 r_val=dft_control%sic_scaling_b)
469 CALL read_rtp_section(dft_control, tmp_section)
476 IF (dft_control%do_xas_calculation)
THEN
479 l_val=dft_control%do_xas_calculation)
483 CALL section_vals_get(tmp_section, explicit=dft_control%do_xas_tdp_calculation)
484 IF (dft_control%do_xas_tdp_calculation)
THEN
487 l_val=dft_control%do_xas_tdp_calculation)
491 dft_control%apply_efield = .false.
492 dft_control%apply_efield_field = .false.
493 dft_control%apply_vector_potential = .false.
497 ALLOCATE (dft_control%efield_fields(nrep))
498 CALL read_efield_sections(dft_control, tmp_section)
500 IF (.NOT. dft_control%rtp_control%velocity_gauge)
THEN
501 dft_control%apply_efield_field = .true.
503 dft_control%apply_vector_potential = .true.
505 dft_control%rtp_control%vec_pot = dft_control%efield_fields(1)%efield%vec_pot_initial
508 dft_control%apply_efield = .true.
515 CALL section_vals_get(tmp_section, explicit=dft_control%apply_period_efield)
516 IF (dft_control%apply_period_efield)
THEN
517 ALLOCATE (dft_control%period_efield)
519 dft_control%period_efield%polarisation(1:3) = pol(1:3)
521 dft_control%period_efield%d_filter(1:3) = pol(1:3)
523 r_val=dft_control%period_efield%strength)
524 dft_control%period_efield%displacement_field = .false.
526 l_val=dft_control%period_efield%displacement_field)
532 IF (
SIZE(pol) > 1 .OR. pol(1) /= 0.0_dp)
THEN
534 IF (dft_control%period_efield%strength /= 0.0_dp .OR. intensities_file_name /=
"")
THEN
535 CALL cp_abort(__location__,
"[PERIODIC FIELD] Only one of INTENSITY, INTENSITY_LIST "// &
536 "or INTENSITIES_FILE_NAME can be specified.")
539 ALLOCATE (dft_control%period_efield%strength_list(
SIZE(pol)))
540 dft_control%period_efield%strength_list(1:
SIZE(pol)) = pol(1:
SIZE(pol))
543 IF (intensities_file_name /=
"")
THEN
545 IF (dft_control%period_efield%strength /= 0.0_dp)
THEN
546 CALL cp_abort(__location__,
"[PERIODIC FIELD] Only one of INTENSITY, INTENSITY_LIST "// &
547 "or INTENSITIES_FILE_NAME can be specified.")
560 cpabort(
"[PERIODIC FIELD] No intensities found in INTENSITIES_FILE_NAME")
563 ALLOCATE (dft_control%period_efield%strength_list(nrep))
568 READ (parser%input_line, *) dft_control%period_efield%strength_list(irep)
575 i_val=dft_control%period_efield%start_frame)
577 i_val=dft_control%period_efield%end_frame)
579 IF (dft_control%period_efield%end_frame /= -1)
THEN
583 IF (dft_control%period_efield%start_frame > dft_control%period_efield%end_frame)
THEN
584 cpabort(
"[PERIODIC FIELD] START_FRAME > END_FRAME")
585 ELSE IF (dft_control%period_efield%start_frame < 1)
THEN
586 cpabort(
"[PERIODIC FIELD] START_FRAME < 1")
587 ELSE IF (mod(dft_control%period_efield%end_frame - &
588 dft_control%period_efield%start_frame + 1,
SIZE(pol)) /= 0)
THEN
589 CALL cp_abort(__location__, &
590 "[PERIODIC FIELD] Number of active frames must be a multiple of the number of intensities")
595 cpassert(.NOT. do_rtp)
596 IF (dft_control%period_efield%displacement_field)
THEN
606 CALL section_vals_get(tmp_section, explicit=dft_control%apply_external_potential)
607 IF (dft_control%apply_external_potential)
THEN
610 l_val=dft_control%expot_control%read_from_cube)
612 l_val=dft_control%expot_control%static)
614 r_val=dft_control%expot_control%scaling_factor)
619 dft_control%expot_control%maxwell_solver = .true.
623 r_val=dft_control%maxwell_control%real_test)
625 i_val=dft_control%maxwell_control%int_test)
627 l_val=dft_control%maxwell_control%log_test)
629 dft_control%expot_control%maxwell_solver = .false.
639 l_val=dft_control%do_sccs)
640 IF (dft_control%do_sccs)
THEN
641 ALLOCATE (dft_control%sccs_control)
643 r_val=dft_control%sccs_control%epsilon_solvent)
645 r_val=dft_control%sccs_control%alpha_solvent)
647 r_val=dft_control%sccs_control%beta_solvent)
649 r_val=dft_control%sccs_control%delta_rho)
651 i_val=dft_control%sccs_control%derivative_method)
653 i_val=dft_control%sccs_control%method_id)
655 r_val=dft_control%sccs_control%eps_sccs)
657 r_val=dft_control%sccs_control%eps_scf)
659 r_val=dft_control%sccs_control%gamma_solvent)
661 i_val=dft_control%sccs_control%max_iter)
663 r_val=dft_control%sccs_control%mixing)
664 SELECT CASE (dft_control%sccs_control%method_id)
668 r_val=dft_control%sccs_control%rho_max)
670 r_val=dft_control%sccs_control%rho_min)
671 IF (dft_control%sccs_control%rho_max < dft_control%sccs_control%rho_min)
THEN
672 CALL cp_abort(__location__, &
673 "The SCCS parameter RHO_MAX is smaller than RHO_MIN. "// &
674 "Please, check your input!")
680 r_val=dft_control%sccs_control%beta)
681 IF (dft_control%sccs_control%beta < 0.5_dp)
THEN
682 CALL cp_abort(__location__, &
683 "A value smaller than 0.5 for the SCCS parameter beta "// &
684 "causes numerical problems. Please, check your input!")
687 r_val=dft_control%sccs_control%rho_zero)
690 cpabort(
"Invalid SCCS model specified. Please, check your input!")
699 CALL section_vals_get(tmp_section, explicit=dft_control%apply_external_density)
742 CHARACTER(len=*),
PARAMETER :: routinen =
'read_mgrid_section'
744 INTEGER :: handle, igrid_level, ngrid_level
745 LOGICAL :: explicit, multigrid_set
747 REAL(
dp),
DIMENSION(:),
POINTER :: cutofflist
750 CALL timeset(routinen, handle)
752 NULLIFY (mgrid_section, cutofflist)
758 CALL section_vals_val_get(mgrid_section,
"PROGRESSION_FACTOR", r_val=qs_control%progression_factor)
763 l_val=qs_control%skip_load_balance_distributed)
766 IF (qs_control%semi_empirical .OR. qs_control%dftb .OR. qs_control%xtb)
THEN
768 multigrid_set = .false.
771 IF (.NOT. explicit) cutoff = 1.0_dp
774 ALLOCATE (qs_control%e_cutoff(ngrid_level))
775 qs_control%cutoff = cutoff
777 IF (multigrid_set)
THEN
779 IF (qs_control%commensurate_mgrids)
THEN
780 cpabort(
"Do not specify cutoffs for the commensurate grids (NYI)")
784 IF (
ASSOCIATED(cutofflist))
THEN
785 IF (
SIZE(cutofflist, 1) /= ngrid_level)
THEN
786 cpabort(
"Number of multi-grids requested and number of cutoff values do not match")
788 DO igrid_level = 1, ngrid_level
789 qs_control%e_cutoff(igrid_level) = cutofflist(igrid_level)
793 DO igrid_level = ngrid_level, 1, -1
794 IF (qs_control%cutoff <= qs_control%e_cutoff(igrid_level))
THEN
795 qs_control%cutoff = qs_control%e_cutoff(igrid_level)
799 IF (igrid_level == 1)
THEN
800 qs_control%cutoff = qs_control%e_cutoff(1)
804 IF (qs_control%commensurate_mgrids) qs_control%progression_factor = 4.0_dp
805 qs_control%e_cutoff(1) = qs_control%cutoff
806 DO igrid_level = 2, ngrid_level
807 qs_control%e_cutoff(igrid_level) = qs_control%e_cutoff(igrid_level - 1)/ &
808 qs_control%progression_factor
812 DO igrid_level = 2, ngrid_level
813 IF (qs_control%e_cutoff(igrid_level) > qs_control%e_cutoff(igrid_level - 1))
THEN
814 cpabort(
"The cutoff values for the multi-grids are not ordered from large to small")
815 ELSE IF (qs_control%e_cutoff(igrid_level) == qs_control%e_cutoff(igrid_level - 1))
THEN
816 cpabort(
"The same cutoff value was specified for two multi-grids")
819 CALL timestop(handle)
832 CHARACTER(len=*),
PARAMETER :: routinen =
'read_qs_section'
834 CHARACTER(LEN=default_string_length) :: cval
835 CHARACTER(LEN=default_string_length), &
836 DIMENSION(:),
POINTER :: clist
837 INTEGER :: handle, itmp, j, jj, k, n_rep, n_var, &
839 INTEGER,
DIMENSION(:),
POINTER :: tmplist
840 LOGICAL :: explicit, was_present
841 REAL(
dp) :: tmp, tmpsqrt, value
842 REAL(
dp),
POINTER :: scal(:)
843 TYPE(
section_vals_type),
POINTER :: cdft_control_section, ddapc_restraint_section, &
844 dftb_parameter, dftb_section, eeq_section, genpot_section, lri_optbas_section, &
845 mull_section, nonbonded_section, s2_restraint_section, se_section, xtb_parameter, &
846 xtb_section, xtb_tblite
848 CALL timeset(routinen, handle)
850 was_present = .false.
851 NULLIFY (mull_section, ddapc_restraint_section, s2_restraint_section, &
852 se_section, dftb_section, xtb_section, dftb_parameter, xtb_parameter, lri_optbas_section, &
853 cdft_control_section, genpot_section, eeq_section)
873 tmpsqrt = sqrt(
value)
876 qs_control%eps_core_charge =
value/100.0_dp
879 qs_control%eps_pgf_orb = tmpsqrt
880 qs_control%eps_kg_orb = qs_control%eps_pgf_orb
882 qs_control%eps_ppnl = qs_control%eps_pgf_orb/100.0_dp
884 qs_control%eps_ppl = 1.0e-2_dp
886 qs_control%gapw_control%eps_cpc =
value
888 qs_control%eps_rho_gspace =
value
889 qs_control%eps_rho_rspace =
value
891 qs_control%eps_gvg_rspace = tmpsqrt
908 qs_control%eps_kg_orb = sqrt(tmp)
921 qs_control%eps_rho_rspace = qs_control%eps_rho_gspace
945 qs_control%gapw_control%lrho1_eq_lrho0 = .false.
946 qs_control%gapw_control%alpha0_hard_from_input = .false.
947 IF (qs_control%gapw_control%alpha0_hard /= 0.0_dp) qs_control%gapw_control%alpha0_hard_from_input = .true.
949 CALL section_vals_val_get(qs_section,
"MAX_RAD_LOCAL", r_val=qs_control%gapw_control%max_rad_local)
959 CALL section_vals_val_get(qs_section,
"CLUSTER_EMBED_SUBSYS", l_val=qs_control%cluster_embed_subsys)
960 CALL section_vals_val_get(qs_section,
"HIGH_LEVEL_EMBED_SUBSYS", l_val=qs_control%high_level_embed_subsys)
971 IF (qs_control%gapw_control%basis_1c /=
gapw_1c_orb)
THEN
972 qs_control%gapw_control%eps_svd = max(qs_control%gapw_control%eps_svd, 1.e-12_dp)
979 qs_control%pw_grid_opt%spherical = .true.
980 qs_control%pw_grid_opt%fullspace = .false.
982 qs_control%pw_grid_opt%spherical = .false.
983 qs_control%pw_grid_opt%fullspace = .true.
985 qs_control%pw_grid_opt%spherical = .false.
986 qs_control%pw_grid_opt%fullspace = .false.
991 qs_control%do_ppl_method = itmp
994 qs_control%pw_grid_opt%distribution_layout = tmplist
998 CALL section_vals_val_get(qs_section,
"EXTRAPOLATION", i_val=qs_control%wf_interpolation_method_nr)
999 CALL section_vals_val_get(qs_section,
"EXTRAPOLATION_ORDER", i_val=qs_control%wf_extrapolation_order)
1003 qs_control%gapw = .false.
1004 qs_control%gapw_xc = .false.
1005 qs_control%gpw = .false.
1006 qs_control%pao = .false.
1007 qs_control%dftb = .false.
1008 qs_control%xtb = .false.
1009 qs_control%semi_empirical = .false.
1010 qs_control%ofgpw = .false.
1011 qs_control%lrigpw = .false.
1012 qs_control%rigpw = .false.
1013 SELECT CASE (qs_control%method_id)
1017 qs_control%gapw = .true.
1019 qs_control%gapw_xc = .true.
1023 qs_control%gpw = .true.
1025 qs_control%ofgpw = .true.
1027 qs_control%lrigpw = .true.
1029 qs_control%rigpw = .true.
1031 qs_control%dftb = .true.
1035 qs_control%xtb = .true.
1040 qs_control%semi_empirical = .true.
1043 qs_control%semi_empirical = .true.
1046 qs_control%semi_empirical = .true.
1049 qs_control%semi_empirical = .true.
1052 qs_control%semi_empirical = .true.
1055 qs_control%semi_empirical = .true.
1058 qs_control%semi_empirical = .true.
1061 qs_control%semi_empirical = .true.
1065 qs_control%semi_empirical = .true.
1068 CALL section_vals_get(mull_section, explicit=qs_control%mulliken_restraint)
1070 IF (qs_control%mulliken_restraint)
THEN
1071 CALL section_vals_val_get(mull_section,
"STRENGTH", r_val=qs_control%mulliken_restraint_control%strength)
1072 CALL section_vals_val_get(mull_section,
"TARGET", r_val=qs_control%mulliken_restraint_control%target)
1077 jj = jj +
SIZE(tmplist)
1079 qs_control%mulliken_restraint_control%natoms = jj
1080 IF (qs_control%mulliken_restraint_control%natoms < 1) &
1081 cpabort(
"Need at least 1 atom to use mulliken constraints")
1082 ALLOCATE (qs_control%mulliken_restraint_control%atoms(qs_control%mulliken_restraint_control%natoms))
1086 DO j = 1,
SIZE(tmplist)
1088 qs_control%mulliken_restraint_control%atoms(jj) = tmplist(j)
1092 CALL section_vals_get(ddapc_restraint_section, n_repetition=nrep, explicit=qs_control%ddapc_restraint)
1093 IF (qs_control%ddapc_restraint)
THEN
1094 ALLOCATE (qs_control%ddapc_restraint_control(nrep))
1096 qs_control%ddapc_restraint_is_spin = .false.
1097 qs_control%ddapc_explicit_potential = .false.
1100 CALL section_vals_get(s2_restraint_section, explicit=qs_control%s2_restraint)
1101 IF (qs_control%s2_restraint)
THEN
1103 r_val=qs_control%s2_restraint_control%strength)
1105 r_val=qs_control%s2_restraint_control%target)
1107 i_val=qs_control%s2_restraint_control%functional_form)
1111 IF (qs_control%cdft)
THEN
1116 IF (qs_control%semi_empirical)
THEN
1118 l_val=qs_control%se_control%orthogonal_basis)
1120 r_val=qs_control%se_control%delta)
1122 l_val=qs_control%se_control%analytical_gradients)
1124 l_val=qs_control%se_control%force_kdsod_EX)
1127 i_val=qs_control%se_control%integral_screening)
1130 CALL cp_warn(__location__, &
1131 "PNNL semi-empirical parameterization supports only the Slater type "// &
1132 "integral scheme. Revert to Slater and continue the calculation.")
1137 i_val=qs_control%se_control%ga_ncells)
1140 r_val=qs_control%se_control%cutoff_lrc)
1141 qs_control%se_control%taper_lrc = qs_control%se_control%cutoff_lrc
1146 r_val=qs_control%se_control%taper_lrc)
1149 r_val=qs_control%se_control%range_lrc)
1152 r_val=qs_control%se_control%cutoff_cou)
1153 qs_control%se_control%taper_cou = qs_control%se_control%cutoff_cou
1158 r_val=qs_control%se_control%taper_cou)
1161 r_val=qs_control%se_control%range_cou)
1164 r_val=qs_control%se_control%cutoff_exc)
1165 qs_control%se_control%taper_exc = qs_control%se_control%cutoff_exc
1170 r_val=qs_control%se_control%taper_exc)
1173 r_val=qs_control%se_control%range_exc)
1177 r_val=qs_control%se_control%taper_scr)
1179 r_val=qs_control%se_control%range_scr)
1183 i_val=qs_control%se_control%periodic_type)
1184 SELECT CASE (qs_control%se_control%periodic_type)
1186 qs_control%se_control%do_ewald = .false.
1187 qs_control%se_control%do_ewald_r3 = .false.
1188 qs_control%se_control%do_ewald_gks = .false.
1190 qs_control%se_control%do_ewald = .true.
1191 qs_control%se_control%do_ewald_r3 = .false.
1192 qs_control%se_control%do_ewald_gks = .false.
1194 qs_control%se_control%do_ewald = .false.
1195 qs_control%se_control%do_ewald_r3 = .false.
1196 qs_control%se_control%do_ewald_gks = .true.
1198 CALL cp_abort(__location__, &
1199 "A periodic semi-empirical calculation was requested with a long-range "// &
1200 "summation on the single integral evaluation. This scheme is supported "// &
1201 "only by the PNNL parameterization.")
1203 qs_control%se_control%do_ewald = .true.
1204 qs_control%se_control%do_ewald_r3 = .true.
1205 qs_control%se_control%do_ewald_gks = .false.
1206 IF (qs_control%se_control%integral_screening /=
do_se_is_kdso) &
1207 CALL cp_abort(__location__, &
1208 "A periodic semi-empirical calculation was requested with a long-range "// &
1209 "summation for the slowly convergent part 1/R^3, which is not congruent "// &
1210 "with the integral screening chosen. The only integral screening supported "// &
1211 "by this periodic type calculation is the standard Klopman-Dewar-Sabelli-Ohno.")
1216 l_val=qs_control%se_control%dispersion)
1218 r_val=qs_control%se_control%rcdisp)
1220 r_val=qs_control%se_control%epscn)
1222 qs_control%se_control%sd3(1) = scal(1)
1223 qs_control%se_control%sd3(2) = scal(2)
1224 qs_control%se_control%sd3(3) = scal(3)
1226 c_val=qs_control%se_control%dispersion_parameter_file)
1230 cpabort(
"EWALD_R3 not implemented yet!")
1242 qs_control%se_control%orthogonal_basis = .true.
1247 IF (qs_control%dftb)
THEN
1249 l_val=qs_control%dftb_control%orthogonal_basis)
1251 l_val=qs_control%dftb_control%self_consistent)
1253 l_val=qs_control%dftb_control%dispersion)
1255 l_val=qs_control%dftb_control%dftb3_diagonal)
1257 l_val=qs_control%dftb_control%hb_sr_damp)
1259 r_val=qs_control%dftb_control%eps_disp)
1263 l_val=qs_control%dftb_control%do_ewald)
1265 qs_control%dftb_control%do_ewald = (qs_control%periodicity /= 0)
1268 c_val=qs_control%dftb_control%sk_file_path)
1270 c_val=qs_control%dftb_control%sk_file_list)
1272 r_val=qs_control%dftb_control%hb_sr_para)
1274 ALLOCATE (qs_control%dftb_control%sk_pair_list(3, n_var))
1278 qs_control%dftb_control%sk_pair_list(1:3, k) = clist(1:3)
1282 i_val=qs_control%dftb_control%dispersion_type)
1284 c_val=qs_control%dftb_control%uff_force_field)
1287 r_val=qs_control%dftb_control%rcdisp)
1289 r_val=qs_control%dftb_control%epscn)
1291 r_val=qs_control%dftb_control%exp_pre)
1293 r_val=qs_control%dftb_control%scaling)
1295 qs_control%dftb_control%sd3(1) = scal(1)
1296 qs_control%dftb_control%sd3(2) = scal(2)
1297 qs_control%dftb_control%sd3(3) = scal(3)
1299 qs_control%dftb_control%sd3bj(1) = scal(1)
1300 qs_control%dftb_control%sd3bj(2) = scal(2)
1301 qs_control%dftb_control%sd3bj(3) = scal(3)
1302 qs_control%dftb_control%sd3bj(4) = scal(4)
1304 c_val=qs_control%dftb_control%dispersion_parameter_file)
1306 IF (qs_control%dftb_control%dispersion)
CALL cite_reference(
zhechkov2005)
1307 IF (qs_control%dftb_control%self_consistent)
CALL cite_reference(
elstner1998)
1308 IF (qs_control%dftb_control%hb_sr_damp)
CALL cite_reference(
hu2007)
1312 IF (qs_control%xtb)
THEN
1317 l_val=qs_control%xtb_control%do_ewald)
1319 qs_control%xtb_control%do_ewald = (qs_control%periodicity /= 0)
1337 SELECT CASE (qs_control%xtb_control%gfn_type)
1344 cpabort(
"gfn2-xtb tbd")
1351 qs_control%xtb_control%sto_ng = ngauss
1353 qs_control%xtb_control%h_sto_ng = ngauss
1355 c_val=qs_control%xtb_control%parameter_file_path)
1359 c_val=qs_control%xtb_control%parameter_file_name)
1361 SELECT CASE (qs_control%xtb_control%gfn_type)
1363 qs_control%xtb_control%parameter_file_name =
"xTB0_parameters"
1365 qs_control%xtb_control%parameter_file_name =
"xTB1_parameters"
1367 cpabort(
"gfn2-xtb tbd")
1374 r_val=qs_control%xtb_control%rcdisp)
1376 r_val=qs_control%xtb_control%epscn)
1380 qs_control%xtb_control%s6 = scal(1)
1381 qs_control%xtb_control%s8 = scal(2)
1383 SELECT CASE (qs_control%xtb_control%gfn_type)
1385 qs_control%xtb_control%s6 = 1.00_dp
1386 qs_control%xtb_control%s8 = 2.85_dp
1388 qs_control%xtb_control%s6 = 1.00_dp
1389 qs_control%xtb_control%s8 = 2.40_dp
1391 cpabort(
"gfn2-xtb tbd")
1399 qs_control%xtb_control%a1 = scal(1)
1400 qs_control%xtb_control%a2 = scal(2)
1402 SELECT CASE (qs_control%xtb_control%gfn_type)
1404 qs_control%xtb_control%a1 = 0.80_dp
1405 qs_control%xtb_control%a2 = 4.60_dp
1407 qs_control%xtb_control%a1 = 0.63_dp
1408 qs_control%xtb_control%a2 = 5.00_dp
1410 cpabort(
"gfn2-xtb tbd")
1416 c_val=qs_control%xtb_control%dispersion_parameter_file)
1421 qs_control%xtb_control%ks = scal(1)
1422 qs_control%xtb_control%kp = scal(2)
1423 qs_control%xtb_control%kd = scal(3)
1424 qs_control%xtb_control%ksp = scal(4)
1425 qs_control%xtb_control%k2sh = scal(5)
1426 IF (qs_control%xtb_control%gfn_type == 0)
THEN
1428 qs_control%xtb_control%ksp = 0.5_dp*(scal(1) + scal(2))
1431 SELECT CASE (qs_control%xtb_control%gfn_type)
1433 qs_control%xtb_control%ks = 2.00_dp
1434 qs_control%xtb_control%kp = 2.4868_dp
1435 qs_control%xtb_control%kd = 2.27_dp
1436 qs_control%xtb_control%ksp = 2.2434_dp
1437 qs_control%xtb_control%k2sh = 1.1241_dp
1439 qs_control%xtb_control%ks = 1.85_dp
1440 qs_control%xtb_control%kp = 2.25_dp
1441 qs_control%xtb_control%kd = 2.00_dp
1442 qs_control%xtb_control%ksp = 2.08_dp
1443 qs_control%xtb_control%k2sh = 2.85_dp
1445 cpabort(
"gfn2-xtb tbd")
1453 qs_control%xtb_control%kg = scal(1)
1454 qs_control%xtb_control%kf = scal(2)
1456 SELECT CASE (qs_control%xtb_control%gfn_type)
1458 qs_control%xtb_control%kg = 2.00_dp
1459 qs_control%xtb_control%kf = 1.50_dp
1461 qs_control%xtb_control%kg = 2.00_dp
1462 qs_control%xtb_control%kf = 1.50_dp
1464 cpabort(
"gfn2-xtb tbd")
1470 qs_control%xtb_control%kcns = scal(1)
1471 qs_control%xtb_control%kcnp = scal(2)
1472 qs_control%xtb_control%kcnd = scal(3)
1477 SELECT CASE (qs_control%xtb_control%gfn_type)
1479 qs_control%xtb_control%ksen = scal(1)
1480 qs_control%xtb_control%kpen = scal(2)
1481 qs_control%xtb_control%kden = scal(3)
1483 qs_control%xtb_control%ken = scal(1)
1485 cpabort(
"gfn2-xtb tbd")
1490 SELECT CASE (qs_control%xtb_control%gfn_type)
1492 qs_control%xtb_control%ksen = 0.006_dp
1493 qs_control%xtb_control%kpen = -0.001_dp
1494 qs_control%xtb_control%kden = -0.002_dp
1496 qs_control%xtb_control%ken = -0.007_dp
1498 cpabort(
"gfn2-xtb tbd")
1505 qs_control%xtb_control%ben = scal(1)
1510 r_val=qs_control%xtb_control%enscale)
1512 SELECT CASE (qs_control%xtb_control%gfn_type)
1514 qs_control%xtb_control%enscale = -0.09_dp
1516 qs_control%xtb_control%enscale = 0._dp
1518 cpabort(
"gfn2-xtb tbd")
1525 l_val=qs_control%xtb_control%xb_interaction)
1527 qs_control%xtb_control%kxr = scal(1)
1528 qs_control%xtb_control%kx2 = scal(2)
1531 l_val=qs_control%xtb_control%do_nonbonded)
1533 IF (explicit .AND. qs_control%xtb_control%do_nonbonded)
THEN
1537 CALL read_gp_section(qs_control%xtb_control%nonbonded, genpot_section, 0)
1541 r_val=qs_control%xtb_control%eps_pair)
1544 qs_control%xtb_control%coulomb_sr_cut = scal(1)
1546 qs_control%xtb_control%coulomb_sr_eps = scal(1)
1552 SELECT CASE (qs_control%xtb_control%gfn_type)
1554 qs_control%xtb_control%coulomb_interaction = .false.
1555 qs_control%xtb_control%coulomb_lr = .false.
1556 qs_control%xtb_control%tb3_interaction = .false.
1557 qs_control%xtb_control%check_atomic_charges = .false.
1559 l_val=qs_control%xtb_control%var_dipole)
1563 l_val=qs_control%xtb_control%coulomb_interaction)
1565 l_val=qs_control%xtb_control%coulomb_lr)
1567 l_val=qs_control%xtb_control%tb3_interaction)
1570 l_val=qs_control%xtb_control%check_atomic_charges)
1571 qs_control%xtb_control%var_dipole = .false.
1573 cpabort(
"gfn2-xtb tbd")
1577 qs_control%xtb_control%kab_nval = n_rep
1579 ALLOCATE (qs_control%xtb_control%kab_param(3, n_rep))
1580 ALLOCATE (qs_control%xtb_control%kab_types(2, n_rep))
1581 ALLOCATE (qs_control%xtb_control%kab_vals(n_rep))
1584 qs_control%xtb_control%kab_param(1, j) = clist(1)
1586 ielement=qs_control%xtb_control%kab_types(1, j))
1587 qs_control%xtb_control%kab_param(2, j) = clist(2)
1589 ielement=qs_control%xtb_control%kab_types(2, j))
1590 qs_control%xtb_control%kab_param(3, j) = clist(3)
1591 READ (clist(3),
'(F10.0)') qs_control%xtb_control%kab_vals(j)
1595 IF (qs_control%xtb_control%gfn_type == 0)
THEN
1597 qs_control%xtb_control%ksrb = scal(1)
1598 qs_control%xtb_control%esrb = scal(2)
1599 qs_control%xtb_control%gscal = scal(3)
1600 qs_control%xtb_control%c1srb = scal(4)
1601 qs_control%xtb_control%c2srb = scal(5)
1602 qs_control%xtb_control%shift = scal(6)
1607 SELECT CASE (trim(cval))
1609 qs_control%xtb_control%enshift_type = 0
1611 qs_control%xtb_control%enshift_type = 1
1613 qs_control%xtb_control%enshift_type = 2
1615 cpabort(
"Unknown value for EN_SHIFT_TYPE")
1619 CALL read_eeq_param(eeq_section, qs_control%xtb_control%eeq_sparam)
1628 l_val=qs_control%xtb_control%do_tblite)
1630 i_val=qs_control%xtb_control%tblite_method)
1631 IF (qs_control%xtb_control%do_tblite)
THEN
1638 qs_control%xtb_control%do_ewald = .false.
1641 CALL timestop(handle)
1655 CHARACTER(LEN=*),
PARAMETER :: routinen =
'read_tddfpt2_control'
1657 CHARACTER(LEN=default_string_length), &
1658 DIMENSION(:),
POINTER :: tmpstringlist
1659 INTEGER :: handle, irep, isize, nrep
1660 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: inds
1661 LOGICAL :: do_ewald, do_exchange, expl, explicit, &
1663 REAL(kind=
dp) :: filter, fval, hfx
1665 soc_section, stda_section, xc_func, &
1668 CALL timeset(routinen, handle)
1683 CALL section_vals_val_get(t_section,
"MIN_AMPLITUDE", r_val=t_control%min_excitation_amplitude)
1690 CALL section_vals_val_get(t_section,
"ADMM_KERNEL_CORRECTION_SYMMETRIC", l_val=t_control%admm_symm)
1691 CALL section_vals_val_get(t_section,
"ADMM_KERNEL_XC_CORRECTION", l_val=t_control%admm_xc_correction)
1692 CALL section_vals_val_get(t_section,
"EXCITON_DESCRIPTORS", l_val=t_control%do_exciton_descriptors)
1693 CALL section_vals_val_get(t_section,
"DIRECTIONAL_EXCITON_DESCRIPTORS", l_val=t_control%do_directional_exciton_descriptors)
1699 IF (
SIZE(tmpstringlist) == 2)
THEN
1701 SELECT CASE (tmpstringlist(2))
1713 cpabort(
"Unknown basis size in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
1716 SELECT CASE (tmpstringlist(1))
1719 t_control%auto_basis_p_lri_aux = isize
1721 cpabort(
"Unknown basis type in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
1724 CALL cp_abort(__location__, &
1725 "AUTO_BASIS keyword in &PROPERTIES &TDDFT section has a wrong number of arguments.")
1729 IF (t_control%conv < 0) &
1730 t_control%conv = abs(t_control%conv)
1738 t_control%dipole_form = 0
1743 CALL section_vals_val_get(dipole_section,
"REFERENCE_POINT", r_vals=t_control%dipole_ref_point)
1745 NULLIFY (t_control%dipole_ref_point)
1747 cpabort(
"User-defined reference point should be given explicitly")
1755 t_control%do_soc = .true.
1762 IF (t_control%mgrid_is_explicit)
THEN
1763 CALL section_vals_val_get(mgrid_section,
"NGRIDS", i_val=t_control%mgrid_ngrids, explicit=explicit)
1764 IF (.NOT. explicit) t_control%mgrid_ngrids =
SIZE(qs_control%e_cutoff)
1766 CALL section_vals_val_get(mgrid_section,
"CUTOFF", r_val=t_control%mgrid_cutoff, explicit=explicit)
1767 IF (.NOT. explicit) t_control%mgrid_cutoff = qs_control%cutoff
1770 r_val=t_control%mgrid_progression_factor, explicit=explicit)
1772 IF (t_control%mgrid_progression_factor <= 1.0_dp) &
1773 CALL cp_abort(__location__, &
1774 "Progression factor should be greater then 1.0 to ensure multi-grid ordering")
1776 t_control%mgrid_progression_factor = qs_control%progression_factor
1779 CALL section_vals_val_get(mgrid_section,
"COMMENSURATE", l_val=t_control%mgrid_commensurate_mgrids, explicit=explicit)
1780 IF (.NOT. explicit) t_control%mgrid_commensurate_mgrids = qs_control%commensurate_mgrids
1781 IF (t_control%mgrid_commensurate_mgrids)
THEN
1783 t_control%mgrid_progression_factor = 4.0_dp
1785 t_control%mgrid_progression_factor = qs_control%progression_factor
1789 CALL section_vals_val_get(mgrid_section,
"REL_CUTOFF", r_val=t_control%mgrid_relative_cutoff, explicit=explicit)
1790 IF (.NOT. explicit) t_control%mgrid_relative_cutoff = qs_control%relative_cutoff
1792 CALL section_vals_val_get(mgrid_section,
"MULTIGRID_SET", l_val=multigrid_set, explicit=explicit)
1793 IF (.NOT. explicit) multigrid_set = .false.
1794 IF (multigrid_set)
THEN
1797 NULLIFY (t_control%mgrid_e_cutoff)
1800 CALL section_vals_val_get(mgrid_section,
"REALSPACE", l_val=t_control%mgrid_realspace_mgrids, explicit=explicit)
1801 IF (.NOT. explicit) t_control%mgrid_realspace_mgrids = qs_control%realspace_mgrids
1804 l_val=t_control%mgrid_skip_load_balance, explicit=explicit)
1805 IF (.NOT. explicit) t_control%mgrid_skip_load_balance = qs_control%skip_load_balance_distributed
1807 IF (
ASSOCIATED(t_control%mgrid_e_cutoff))
THEN
1808 IF (
SIZE(t_control%mgrid_e_cutoff) /= t_control%mgrid_ngrids) &
1809 cpabort(
"Inconsistent values for number of multi-grids")
1812 t_control%mgrid_e_cutoff = -t_control%mgrid_e_cutoff
1813 ALLOCATE (inds(t_control%mgrid_ngrids))
1814 CALL sort(t_control%mgrid_e_cutoff, t_control%mgrid_ngrids, inds)
1816 t_control%mgrid_e_cutoff = -t_control%mgrid_e_cutoff
1830 t_control%stda_control%hfx_fraction = 0.0_dp
1831 t_control%stda_control%do_exchange = .true.
1832 t_control%stda_control%eps_td_filter = 1.e-10_dp
1833 t_control%stda_control%mn_alpha = -99.0_dp
1834 t_control%stda_control%mn_beta = -99.0_dp
1836 SELECT CASE (qs_control%periodicity)
1838 t_control%stda_control%do_ewald = .false.
1840 t_control%stda_control%do_ewald = .true.
1842 t_control%stda_control%do_ewald = .true.
1844 t_control%stda_control%do_ewald = .true.
1846 cpabort(
"Illegal value for periodiciy")
1851 IF (expl) t_control%stda_control%hfx_fraction = hfx
1853 IF (expl) t_control%stda_control%eps_td_filter = filter
1855 IF (expl) t_control%stda_control%do_ewald = do_ewald
1857 IF (expl) t_control%stda_control%do_exchange = do_exchange
1859 t_control%stda_control%mn_alpha = fval
1861 t_control%stda_control%mn_beta = fval
1864 t_control%stda_control%coulomb_sr_cut = fval
1866 t_control%stda_control%coulomb_sr_eps = fval
1869 CALL timestop(handle)
1881 CHARACTER(len=*),
PARAMETER :: routinen =
'write_dft_control'
1883 CHARACTER(LEN=20) :: tmpstr
1884 INTEGER :: handle, i, i_rep, n_rep, output_unit
1885 REAL(kind=
dp) :: density_cut, density_smooth_cut_range, &
1886 gradient_cut, tau_cut
1893 IF (dft_control%qs_control%semi_empirical)
RETURN
1894 IF (dft_control%qs_control%dftb)
RETURN
1895 IF (dft_control%qs_control%xtb)
THEN
1896 CALL write_xtb_control(dft_control%qs_control%xtb_control, dft_section)
1899 CALL timeset(routinen, handle)
1905 "PRINT%DFT_CONTROL_PARAMETERS", extension=
".Log")
1907 IF (output_unit > 0)
THEN
1911 IF (dft_control%uks)
THEN
1912 WRITE (unit=output_unit, fmt=
"(/,T2,A,T78,A)") &
1913 "DFT| Spin unrestricted (spin-polarized) Kohn-Sham calculation",
"UKS"
1914 ELSE IF (dft_control%roks)
THEN
1915 WRITE (unit=output_unit, fmt=
"(/,T2,A,T77,A)") &
1916 "DFT| Spin restricted open Kohn-Sham calculation",
"ROKS"
1918 WRITE (unit=output_unit, fmt=
"(/,T2,A,T78,A)") &
1919 "DFT| Spin restricted Kohn-Sham (RKS) calculation",
"RKS"
1922 WRITE (unit=output_unit, fmt=
"(T2,A,T76,I5)") &
1923 "DFT| Multiplicity", dft_control%multiplicity
1924 WRITE (unit=output_unit, fmt=
"(T2,A,T76,I5)") &
1925 "DFT| Number of spin states", dft_control%nspins
1927 WRITE (unit=output_unit, fmt=
"(T2,A,T76,I5)") &
1928 "DFT| Charge", dft_control%charge
1931 SELECT CASE (dft_control%sic_method_id)
1935 tmpstr =
"SPZ/MAURI SIC"
1937 tmpstr =
"US/MAURI SIC"
1941 tmpstr =
"Explicit Orbital SIC"
1944 cpabort(
"SIC option unknown")
1947 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
1948 "DFT| Self-interaction correction (SIC)", adjustr(trim(tmpstr))
1950 IF (dft_control%sic_method_id /=
sic_none)
THEN
1951 WRITE (unit=output_unit, fmt=
"(T2,A,T66,ES15.6)") &
1952 "DFT| SIC scaling parameter a", dft_control%sic_scaling_a, &
1953 "DFT| SIC scaling parameter b", dft_control%sic_scaling_b
1956 IF (dft_control%sic_method_id ==
sic_eo)
THEN
1958 WRITE (unit=output_unit, fmt=
"(T2,A,T66,A)") &
1959 "DFT| SIC orbitals",
"ALL"
1962 WRITE (unit=output_unit, fmt=
"(T2,A,T66,A)") &
1963 "DFT| SIC orbitals",
"UNPAIRED"
1970 CALL section_vals_val_get(xc_section,
"density_smooth_cutoff_range", r_val=density_smooth_cut_range)
1972 WRITE (unit=output_unit, fmt=
"(T2,A,T66,ES15.6)") &
1973 "DFT| Cutoffs: density ", density_cut, &
1974 "DFT| gradient", gradient_cut, &
1975 "DFT| tau ", tau_cut, &
1976 "DFT| cutoff_smoothing_range", density_smooth_cut_range
1979 WRITE (output_unit,
'( A, T61, A )') &
1980 " DFT| XC density smoothing ", adjustr(tmpstr)
1983 WRITE (output_unit,
'( A, T61, A )') &
1984 " DFT| XC derivatives ", adjustr(tmpstr)
1985 IF (dft_control%dft_plus_u)
THEN
1986 NULLIFY (enum, keyword, section)
1990 WRITE (unit=output_unit, fmt=
"(/,T2,A,T41,A40)") &
1991 "DFT+U| Method", adjustr(trim(
enum_i2c(enum, dft_control%plus_u_method_id)))
1992 WRITE (unit=output_unit, fmt=
"(T2,A)") &
1993 "DFT+U| Check atomic kind information for details"
1997 WRITE (unit=output_unit, fmt=
"(A)")
""
1998 CALL xc_write(output_unit, xc_section, dft_control%lsd)
2000 IF (dft_control%apply_period_efield)
THEN
2001 WRITE (unit=output_unit, fmt=
"(A)")
""
2002 IF (dft_control%period_efield%displacement_field)
THEN
2003 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2004 "PERIODIC_EFIELD| Use displacement field formulation"
2005 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,ES14.6)") &
2006 "PERIODIC_EFIELD| Displacement field filter: x", &
2007 dft_control%period_efield%d_filter(1), &
2008 "PERIODIC_EFIELD| y", &
2009 dft_control%period_efield%d_filter(2), &
2010 "PERIODIC_EFIELD| z", &
2011 dft_control%period_efield%d_filter(3)
2013 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,ES14.6)") &
2014 "PERIODIC_EFIELD| Polarisation vector: x", &
2015 dft_control%period_efield%polarisation(1), &
2016 "PERIODIC_EFIELD| y", &
2017 dft_control%period_efield%polarisation(2), &
2018 "PERIODIC_EFIELD| z", &
2019 dft_control%period_efield%polarisation(3)
2021 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,I14)") &
2022 "PERIODIC_EFIELD| Start Frame:", &
2023 dft_control%period_efield%start_frame, &
2024 "PERIODIC_EFIELD| End Frame:", &
2025 dft_control%period_efield%end_frame
2027 IF (
ALLOCATED(dft_control%period_efield%strength_list))
THEN
2028 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,I14)") &
2029 "PERIODIC_EFIELD| Number of Intensities:", &
2030 SIZE(dft_control%period_efield%strength_list)
2031 WRITE (unit=output_unit, fmt=
"(T2,A,I10,T66,1X,ES14.6)") &
2032 "PERIODIC_EFIELD| Intensity List [a.u.] ", &
2033 1, dft_control%period_efield%strength_list(1)
2034 DO i = 2,
SIZE(dft_control%period_efield%strength_list)
2035 WRITE (unit=output_unit, fmt=
"(T2,A,I10,T66,1X,ES14.6)") &
2036 "PERIODIC_EFIELD| ", &
2037 i, dft_control%period_efield%strength_list(i)
2040 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,ES14.6)") &
2041 "PERIODIC_EFIELD| Intensity [a.u.]:", &
2042 dft_control%period_efield%strength
2045 IF (sqrt(dot_product(dft_control%period_efield%polarisation, &
2046 dft_control%period_efield%polarisation)) < epsilon(0.0_dp))
THEN
2047 cpabort(
"Invalid (too small) polarisation vector specified for PERIODIC_EFIELD")
2051 IF (dft_control%do_sccs)
THEN
2052 WRITE (unit=output_unit, fmt=
"(/,T2,A)") &
2053 "SCCS| Self-consistent continuum solvation model"
2054 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2055 "SCCS| Relative permittivity of the solvent (medium)", &
2056 dft_control%sccs_control%epsilon_solvent, &
2057 "SCCS| Absolute permittivity [a.u.]", &
2058 dft_control%sccs_control%epsilon_solvent/
fourpi
2059 SELECT CASE (dft_control%sccs_control%method_id)
2061 WRITE (unit=output_unit, fmt=
"(T2,A,/,(T2,A,T61,ES20.6))") &
2062 "SCCS| Dielectric function proposed by Andreussi et al.", &
2063 "SCCS| rho_max", dft_control%sccs_control%rho_max, &
2064 "SCCS| rho_min", dft_control%sccs_control%rho_min
2066 WRITE (unit=output_unit, fmt=
"(T2,A,/,(T2,A,T61,ES20.6))") &
2067 "SCCS| Dielectric function proposed by Fattebert and Gygi", &
2068 "SCCS| beta", dft_control%sccs_control%beta, &
2069 "SCCS| rho_zero", dft_control%sccs_control%rho_zero
2071 cpabort(
"Invalid SCCS model specified. Please, check your input!")
2073 SELECT CASE (dft_control%sccs_control%derivative_method)
2075 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2076 "SCCS| Numerical derivative calculation", &
2079 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2080 "SCCS| Numerical derivative calculation", &
2081 adjustr(
"3-point stencil central differences")
2083 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2084 "SCCS| Numerical derivative calculation", &
2085 adjustr(
"5-point stencil central differences")
2087 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2088 "SCCS| Numerical derivative calculation", &
2089 adjustr(
"7-point stencil central differences")
2091 CALL cp_abort(__location__, &
2092 "Invalid derivative method specified for SCCS model. "// &
2093 "Please, check your input!")
2095 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2096 "SCCS| Repulsion parameter alpha [mN/m] = [dyn/cm]", &
2098 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2099 "SCCS| Dispersion parameter beta [GPa]", &
2101 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2102 "SCCS| Surface tension gamma [mN/m] = [dyn/cm]", &
2104 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2105 "SCCS| Mixing parameter applied during the iteration cycle", &
2106 dft_control%sccs_control%mixing
2107 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2108 "SCCS| Tolerance for the convergence of the SCCS iteration cycle", &
2109 dft_control%sccs_control%eps_sccs
2110 WRITE (unit=output_unit, fmt=
"(T2,A,T61,I20)") &
2111 "SCCS| Maximum number of iteration steps", &
2112 dft_control%sccs_control%max_iter
2113 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2114 "SCCS| SCF convergence threshold for starting the SCCS iteration", &
2115 dft_control%sccs_control%eps_scf
2116 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2117 "SCCS| Numerical increment for the cavity surface calculation", &
2118 dft_control%sccs_control%delta_rho
2121 WRITE (unit=output_unit, fmt=
"(A)")
""
2125 IF (dft_control%hairy_probes .EQV. .true.)
THEN
2126 n_rep =
SIZE(dft_control%probe)
2127 IF (output_unit > 0)
THEN
2129 WRITE (unit=output_unit, fmt=
"(T2,A,I5)") &
2130 "HP | hair probe set", i_rep
2131 WRITE (unit=output_unit, fmt=
"(T2,A,T61,*(I5))") &
2132 "HP| atom indexes", &
2133 (dft_control%probe(i_rep)%atom_ids(i), i=1, dft_control%probe(i_rep)%natoms)
2134 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2135 "HP| potential", dft_control%probe(i_rep)%mu
2136 WRITE (unit=output_unit, fmt=
"(T2,A,T61,F20.2)") &
2137 "HP| temperature", dft_control%probe(i_rep)%T
2138 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2139 "HP| eps_hp", dft_control%probe(i_rep)%eps_hp
2145 "PRINT%DFT_CONTROL_PARAMETERS")
2147 CALL timestop(handle)
2167 "PRINT%DFT_CONTROL_PARAMETERS", extension=
".Log")
2169 IF (iounit > 0)
THEN
2171 SELECT CASE (admm_control%admm_type)
2173 WRITE (unit=iounit, fmt=
"(/,T2,A,T77,A)")
"ADMM| Specific ADMM type specified",
"NONE"
2175 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMM1"
2177 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMM2"
2179 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMMS"
2181 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMMP"
2183 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMMQ"
2185 cpabort(
"admm_type")
2188 SELECT CASE (admm_control%purification_method)
2190 WRITE (unit=iounit, fmt=
"(T2,A,T77,A)")
"ADMM| Density matrix purification method",
"NONE"
2192 WRITE (unit=iounit, fmt=
"(T2,A,T75,A)")
"ADMM| Density matrix purification method",
"Cauchy"
2194 WRITE (unit=iounit, fmt=
"(T2,A,T66,A)")
"ADMM| Density matrix purification method",
"Cauchy subspace"
2196 WRITE (unit=iounit, fmt=
"(T2,A,T63,A)")
"ADMM| Density matrix purification method",
"MO diagonalization"
2198 WRITE (unit=iounit, fmt=
"(T2,A,T71,A)")
"ADMM| Density matrix purification method",
"MO no diag"
2200 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Density matrix purification method",
"McWeeny"
2202 WRITE (unit=iounit, fmt=
"(T2,A,T73,A)")
"ADMM| Density matrix purification method",
"NONE(DM)"
2204 cpabort(
"admm_purification_method")
2207 SELECT CASE (admm_control%method)
2209 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Orbital projection on ADMM basis"
2211 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Blocked Fock matrix projection with full purification"
2213 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Blocked Fock matrix projection"
2215 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Orbital projection with charge constrain"
2217 cpabort(
"admm method")
2220 SELECT CASE (admm_control%scaling_model)
2223 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Use Merlot (2014) scaling model"
2225 cpabort(
"admm scaling_model")
2228 WRITE (unit=iounit, fmt=
"(T2,A,T61,G20.10)")
"ADMM| eps_filter", admm_control%eps_filter
2230 SELECT CASE (admm_control%aux_exch_func)
2232 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| No exchange functional correction term used"
2234 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Exchange functional in correction term",
"(W)PBEX"
2236 WRITE (unit=iounit, fmt=
"(T2,A,T77,A)")
"ADMM| Exchange functional in correction term",
"PBEX"
2238 WRITE (unit=iounit, fmt=
"(T2,A,T77,A)")
"ADMM| Exchange functional in correction term",
"OPTX"
2240 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Exchange functional in correction term",
"Becke88"
2242 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Exchange functional in correction term",
"SlaterX"
2244 cpabort(
"admm aux_exch_func")
2247 WRITE (unit=iounit, fmt=
"(A)")
""
2252 "PRINT%DFT_CONTROL_PARAMETERS")
2260 SUBROUTINE write_xtb_control(xtb_control, dft_section)
2264 CHARACTER(len=*),
PARAMETER :: routinen =
'write_xtb_control'
2266 INTEGER :: handle, output_unit
2269 CALL timeset(routinen, handle)
2274 "PRINT%DFT_CONTROL_PARAMETERS", extension=
".Log")
2276 IF (output_unit > 0)
THEN
2278 WRITE (unit=output_unit, fmt=
"(/,T2,A,T31,A50)") &
2279 "xTB| Parameter file", adjustr(trim(xtb_control%parameter_file_name))
2280 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2281 "xTB| Basis expansion STO-NG", xtb_control%sto_ng
2282 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2283 "xTB| Basis expansion STO-NG for Hydrogen", xtb_control%h_sto_ng
2284 WRITE (unit=output_unit, fmt=
"(T2,A,T71,E10.4)") &
2285 "xTB| Repulsive pair potential accuracy", xtb_control%eps_pair
2286 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.6)") &
2287 "xTB| Repulsive enhancement factor", xtb_control%enscale
2288 WRITE (unit=output_unit, fmt=
"(T2,A,T71,L10)") &
2289 "xTB| Halogen interaction potential", xtb_control%xb_interaction
2290 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2291 "xTB| Halogen interaction potential cutoff radius", xtb_control%xb_radius
2292 WRITE (unit=output_unit, fmt=
"(T2,A,T71,L10)") &
2293 "xTB| Nonbonded interactions", xtb_control%do_nonbonded
2294 SELECT CASE (xtb_control%vdw_type)
2296 WRITE (unit=output_unit, fmt=
"(T2,A)")
"xTB| No vdW potential selected"
2298 WRITE (unit=output_unit, fmt=
"(T2,A,T72,A)")
"xTB| vdW potential type:",
"DFTD3(BJ)"
2299 WRITE (unit=output_unit, fmt=
"(T2,A,T31,A50)") &
2300 "xTB| D3 Dispersion: Parameter file", adjustr(trim(xtb_control%dispersion_parameter_file))
2302 WRITE (unit=output_unit, fmt=
"(T2,A,T76,A)")
"xTB| vdW potential type:",
"DFTD4"
2303 WRITE (unit=output_unit, fmt=
"(T2,A,T31,A50)") &
2304 "xTB| D4 Dispersion: Parameter file", adjustr(trim(xtb_control%dispersion_parameter_file))
2308 WRITE (unit=output_unit, fmt=
"(T2,A,T51,3F10.3)") &
2309 "xTB| Huckel constants ks kp kd", xtb_control%ks, xtb_control%kp, xtb_control%kd
2310 WRITE (unit=output_unit, fmt=
"(T2,A,T61,2F10.3)") &
2311 "xTB| Huckel constants ksp k2sh", xtb_control%ksp, xtb_control%k2sh
2312 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2313 "xTB| Mataga-Nishimoto exponent", xtb_control%kg
2314 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2315 "xTB| Repulsion potential exponent", xtb_control%kf
2316 WRITE (unit=output_unit, fmt=
"(T2,A,T51,3F10.3)") &
2317 "xTB| Coordination number scaling kcn(s) kcn(p) kcn(d)", &
2318 xtb_control%kcns, xtb_control%kcnp, xtb_control%kcnd
2319 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2320 "xTB| Electronegativity scaling", xtb_control%ken
2321 WRITE (unit=output_unit, fmt=
"(T2,A,T61,2F10.3)") &
2322 "xTB| Halogen potential scaling kxr kx2", xtb_control%kxr, xtb_control%kx2
2323 WRITE (unit=output_unit, fmt=
"(/)")
2328 "PRINT%DFT_CONTROL_PARAMETERS")
2330 CALL timestop(handle)
2332 END SUBROUTINE write_xtb_control
2343 CHARACTER(len=*),
PARAMETER :: routinen =
'write_qs_control'
2345 CHARACTER(len=20) :: method, quadrature
2346 INTEGER :: handle, i, igrid_level, ngrid_level, &
2355 IF (qs_control%semi_empirical)
RETURN
2356 IF (qs_control%dftb)
RETURN
2357 IF (qs_control%xtb)
RETURN
2358 CALL timeset(routinen, handle)
2359 NULLIFY (logger, print_section_vals, qs_section, qs_section_vals)
2365 NULLIFY (enum, keyword)
2368 method = trim(
enum_i2c(enum, qs_control%method_id))
2370 NULLIFY (enum, keyword)
2373 quadrature = trim(
enum_i2c(enum, qs_control%gapw_control%quadrature))
2376 "DFT_CONTROL_PARAMETERS", extension=
".Log")
2377 IF (output_unit > 0)
THEN
2378 ngrid_level =
SIZE(qs_control%e_cutoff)
2379 WRITE (unit=output_unit, fmt=
"(/,T2,A,T61,A20)") &
2380 "QS| Method:", adjustr(method)
2381 IF (qs_control%pw_grid_opt%spherical)
THEN
2382 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A)") &
2383 "QS| Density plane wave grid type",
" SPHERICAL HALFSPACE"
2384 ELSE IF (qs_control%pw_grid_opt%fullspace)
THEN
2385 WRITE (unit=output_unit, fmt=
"(T2,A,T57,A)") &
2386 "QS| Density plane wave grid type",
" NON-SPHERICAL FULLSPACE"
2388 WRITE (unit=output_unit, fmt=
"(T2,A,T57,A)") &
2389 "QS| Density plane wave grid type",
" NON-SPHERICAL HALFSPACE"
2391 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2392 "QS| Number of grid levels:",
SIZE(qs_control%e_cutoff)
2393 IF (ngrid_level == 1)
THEN
2394 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2395 "QS| Density cutoff [a.u.]:", qs_control%e_cutoff(1)
2397 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2398 "QS| Density cutoff [a.u.]:", qs_control%cutoff
2399 IF (qs_control%commensurate_mgrids) &
2400 WRITE (unit=output_unit, fmt=
"(T2,A)")
"QS| Using commensurate multigrids"
2401 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2402 "QS| Multi grid cutoff [a.u.]: 1) grid level", qs_control%e_cutoff(1)
2403 WRITE (unit=output_unit, fmt=
"(T2,A,I3,A,T71,F10.1)") &
2404 (
"QS| ", igrid_level,
") grid level", &
2405 qs_control%e_cutoff(igrid_level), &
2406 igrid_level=2,
SIZE(qs_control%e_cutoff))
2408 IF (qs_control%pao)
THEN
2409 WRITE (unit=output_unit, fmt=
"(T2,A)")
"QS| PAO active"
2411 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2412 "QS| Grid level progression factor:", qs_control%progression_factor
2413 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2414 "QS| Relative density cutoff [a.u.]:", qs_control%relative_cutoff
2415 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2416 "QS| Interaction thresholds: eps_pgf_orb:", &
2417 qs_control%eps_pgf_orb, &
2418 "QS| eps_filter_matrix:", &
2419 qs_control%eps_filter_matrix, &
2420 "QS| eps_core_charge:", &
2421 qs_control%eps_core_charge, &
2422 "QS| eps_rho_gspace:", &
2423 qs_control%eps_rho_gspace, &
2424 "QS| eps_rho_rspace:", &
2425 qs_control%eps_rho_rspace, &
2426 "QS| eps_gvg_rspace:", &
2427 qs_control%eps_gvg_rspace, &
2429 qs_control%eps_ppl, &
2432 IF (qs_control%gapw)
THEN
2433 SELECT CASE (qs_control%gapw_control%basis_1c)
2435 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2436 "QS| GAPW| One center basis from orbital basis primitives"
2438 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2439 "QS| GAPW| One center basis extended with primitives (small:s)"
2441 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2442 "QS| GAPW| One center basis extended with primitives (medium:sp)"
2444 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2445 "QS| GAPW| One center basis extended with primitives (large:spd)"
2447 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2448 "QS| GAPW| One center basis extended with primitives (very large:spdf)"
2450 cpabort(
"basis_1c incorrect")
2452 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2453 "QS| GAPW| eps_fit:", &
2454 qs_control%gapw_control%eps_fit, &
2455 "QS| GAPW| eps_iso:", &
2456 qs_control%gapw_control%eps_iso, &
2457 "QS| GAPW| eps_svd:", &
2458 qs_control%gapw_control%eps_svd, &
2459 "QS| GAPW| eps_cpc:", &
2460 qs_control%gapw_control%eps_cpc
2461 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2462 "QS| GAPW| atom-r-grid: quadrature:", &
2464 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2465 "QS| GAPW| atom-s-grid: max l :", &
2466 qs_control%gapw_control%lmax_sphere, &
2467 "QS| GAPW| max_l_rho0 :", &
2468 qs_control%gapw_control%lmax_rho0
2469 IF (qs_control%gapw_control%non_paw_atoms)
THEN
2470 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2471 "QS| GAPW| At least one kind is NOT PAW, i.e. it has only soft AO "
2473 IF (qs_control%gapw_control%nopaw_as_gpw)
THEN
2474 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2475 "QS| GAPW| The NOT PAW atoms are treated fully GPW"
2478 IF (qs_control%gapw_xc)
THEN
2479 SELECT CASE (qs_control%gapw_control%basis_1c)
2481 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2482 "QS| GAPW_XC| One center basis from orbital basis primitives"
2484 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2485 "QS| GAPW_XC| One center basis extended with primitives (small:s)"
2487 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2488 "QS| GAPW_XC| One center basis extended with primitives (medium:sp)"
2490 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2491 "QS| GAPW_XC| One center basis extended with primitives (large:spd)"
2493 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2494 "QS| GAPW_XC| One center basis extended with primitives (very large:spdf)"
2496 cpabort(
"basis_1c incorrect")
2498 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2499 "QS| GAPW_XC| eps_fit:", &
2500 qs_control%gapw_control%eps_fit, &
2501 "QS| GAPW_XC| eps_iso:", &
2502 qs_control%gapw_control%eps_iso, &
2503 "QS| GAPW_XC| eps_svd:", &
2504 qs_control%gapw_control%eps_svd
2505 WRITE (unit=output_unit, fmt=
"(T2,A,T55,A30)") &
2506 "QS| GAPW_XC|atom-r-grid: quadrature:", &
2507 enum_i2c(enum, qs_control%gapw_control%quadrature)
2508 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2509 "QS| GAPW_XC| atom-s-grid: max l :", &
2510 qs_control%gapw_control%lmax_sphere
2512 IF (qs_control%mulliken_restraint)
THEN
2513 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2514 "QS| Mulliken restraint target", qs_control%mulliken_restraint_control%target
2515 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2516 "QS| Mulliken restraint strength", qs_control%mulliken_restraint_control%strength
2517 WRITE (unit=output_unit, fmt=
"(T2,A,T73,I8)") &
2518 "QS| Mulliken restraint atoms: ", qs_control%mulliken_restraint_control%natoms
2519 WRITE (unit=output_unit, fmt=
"(5I8)") qs_control%mulliken_restraint_control%atoms
2521 IF (qs_control%ddapc_restraint)
THEN
2522 DO i = 1,
SIZE(qs_control%ddapc_restraint_control)
2523 ddapc_restraint_control => qs_control%ddapc_restraint_control(i)
2524 IF (
SIZE(qs_control%ddapc_restraint_control) .GT. 1) &
2525 WRITE (unit=output_unit, fmt=
"(T2,A,T3,I8)") &
2526 "QS| parameters for DDAPC restraint number", i
2527 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2528 "QS| ddapc restraint target", ddapc_restraint_control%target
2529 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2530 "QS| ddapc restraint strength", ddapc_restraint_control%strength
2531 WRITE (unit=output_unit, fmt=
"(T2,A,T73,I8)") &
2532 "QS| ddapc restraint atoms: ", ddapc_restraint_control%natoms
2533 WRITE (unit=output_unit, fmt=
"(5I8)") ddapc_restraint_control%atoms
2534 WRITE (unit=output_unit, fmt=
"(T2,A)")
"Coefficients:"
2535 WRITE (unit=output_unit, fmt=
"(5F6.2)") ddapc_restraint_control%coeff
2536 SELECT CASE (ddapc_restraint_control%functional_form)
2538 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2539 "QS| ddapc restraint functional form :",
"RESTRAINT"
2541 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2542 "QS| ddapc restraint functional form :",
"CONSTRAINT"
2544 cpabort(
"Unknown ddapc restraint")
2548 IF (qs_control%s2_restraint)
THEN
2549 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2550 "QS| s2 restraint target", qs_control%s2_restraint_control%target
2551 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2552 "QS| s2 restraint strength", qs_control%s2_restraint_control%strength
2553 SELECT CASE (qs_control%s2_restraint_control%functional_form)
2555 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2556 "QS| s2 restraint functional form :",
"RESTRAINT"
2557 cpabort(
"Not yet implemented")
2559 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2560 "QS| s2 restraint functional form :",
"CONSTRAINT"
2562 cpabort(
"Unknown ddapc restraint")
2567 "DFT_CONTROL_PARAMETERS")
2569 CALL timestop(handle)
2587 TYPE(
section_vals_type),
OPTIONAL,
POINTER :: qs_section, ddapc_restraint_section
2589 INTEGER :: i, j, jj, k, n_rep
2590 INTEGER,
DIMENSION(:),
POINTER :: tmplist
2591 REAL(kind=
dp),
DIMENSION(:),
POINTER :: rtmplist
2595 IF (
PRESENT(ddapc_restraint_section))
THEN
2596 IF (
ASSOCIATED(qs_control%ddapc_restraint_control))
THEN
2597 IF (
SIZE(qs_control%ddapc_restraint_control) .GE. 2) &
2598 cpabort(
"ET_COUPLING cannot be used in combination with a normal restraint")
2600 ddapc_section => ddapc_restraint_section
2601 ALLOCATE (qs_control%ddapc_restraint_control(1))
2605 IF (
PRESENT(qs_section))
THEN
2606 NULLIFY (ddapc_section)
2611 DO i = 1,
SIZE(qs_control%ddapc_restraint_control)
2614 ddapc_restraint_control => qs_control%ddapc_restraint_control(i)
2617 r_val=ddapc_restraint_control%strength)
2619 r_val=ddapc_restraint_control%target)
2621 i_val=ddapc_restraint_control%functional_form)
2625 i_val=ddapc_restraint_control%density_type)
2630 i_rep_val=k, i_vals=tmplist)
2631 DO j = 1,
SIZE(tmplist)
2635 IF (jj < 1) cpabort(
"Need at least 1 atom to use ddapc constraints")
2636 ddapc_restraint_control%natoms = jj
2637 IF (
ASSOCIATED(ddapc_restraint_control%atoms)) &
2638 DEALLOCATE (ddapc_restraint_control%atoms)
2639 ALLOCATE (ddapc_restraint_control%atoms(ddapc_restraint_control%natoms))
2643 i_rep_val=k, i_vals=tmplist)
2644 DO j = 1,
SIZE(tmplist)
2646 ddapc_restraint_control%atoms(jj) = tmplist(j)
2650 IF (
ASSOCIATED(ddapc_restraint_control%coeff)) &
2651 DEALLOCATE (ddapc_restraint_control%coeff)
2652 ALLOCATE (ddapc_restraint_control%coeff(ddapc_restraint_control%natoms))
2653 ddapc_restraint_control%coeff = 1.0_dp
2660 i_rep_val=k, r_vals=rtmplist)
2661 DO j = 1,
SIZE(rtmplist)
2663 IF (jj > ddapc_restraint_control%natoms) &
2664 cpabort(
"Need the same number of coeff as there are atoms ")
2665 ddapc_restraint_control%coeff(jj) = rtmplist(j)
2668 IF (jj < ddapc_restraint_control%natoms .AND. jj .NE. 0) &
2669 cpabort(
"Need no or the same number of coeff as there are atoms.")
2672 DO i = 1,
SIZE(qs_control%ddapc_restraint_control)
2673 IF (qs_control%ddapc_restraint_control(i)%functional_form == &
2676 IF (k == 2)
CALL cp_abort(__location__, &
2677 "Only a single constraint possible yet, try to use restraints instead ")
2686 SUBROUTINE read_efield_sections(dft_control, efield_section)
2690 CHARACTER(len=default_path_length) :: file_name
2691 INTEGER :: i, io, j, n, unit_nr
2692 REAL(kind=
dp),
DIMENSION(:),
POINTER :: tmp_vals
2696 DO i = 1,
SIZE(dft_control%efield_fields)
2697 NULLIFY (dft_control%efield_fields(i)%efield)
2698 ALLOCATE (dft_control%efield_fields(i)%efield)
2699 efield => dft_control%efield_fields(i)%efield
2700 NULLIFY (efield%envelop_i_vars, efield%envelop_r_vars)
2702 r_val=efield%strength)
2706 ALLOCATE (efield%polarisation(
SIZE(tmp_vals)))
2707 efield%polarisation = tmp_vals
2709 r_val=efield%phase_offset)
2711 i_val=efield%envelop_id)
2713 r_val=efield%wavelength)
2716 efield%vec_pot_initial = tmp_vals
2719 ALLOCATE (efield%envelop_i_vars(2))
2722 i_val=efield%envelop_i_vars(1))
2724 i_val=efield%envelop_i_vars(2))
2726 ALLOCATE (efield%envelop_r_vars(2))
2729 r_val=efield%envelop_r_vars(1))
2731 r_val=efield%envelop_r_vars(2))
2732 ELSE IF (efield%envelop_id ==
ramp_env)
THEN
2733 ALLOCATE (efield%envelop_i_vars(4))
2736 i_val=efield%envelop_i_vars(1))
2738 i_val=efield%envelop_i_vars(2))
2740 i_val=efield%envelop_i_vars(3))
2742 i_val=efield%envelop_i_vars(4))
2743 ELSE IF (efield%envelop_id ==
custom_env)
THEN
2746 CALL open_file(file_name=trim(file_name), file_action=
"READ", file_status=
"OLD", unit_number=unit_nr)
2750 READ (unit_nr, *, iostat=io)
2755 ALLOCATE (efield%envelop_r_vars(n + 1))
2760 READ (unit_nr, *) efield%envelop_r_vars(j)
2761 efield%envelop_r_vars(j) =
cp_unit_to_cp2k(efield%envelop_r_vars(j),
"volt/m")
2766 END SUBROUTINE read_efield_sections
2774 SUBROUTINE read_rtp_section(dft_control, rtp_section)
2779 INTEGER,
DIMENSION(:),
POINTER :: tmp
2780 LOGICAL :: is_present
2783 ALLOCATE (dft_control%rtp_control)
2785 i_val=dft_control%rtp_control%max_iter)
2787 i_val=dft_control%rtp_control%mat_exp)
2789 i_val=dft_control%rtp_control%aspc_order)
2791 r_val=dft_control%rtp_control%eps_exp)
2793 i_val=dft_control%rtp_control%rtp_method)
2795 i_val=dft_control%rtp_control%rtbse_ham)
2797 i_val=dft_control%rtp_control%propagator)
2799 r_val=dft_control%rtp_control%eps_ener)
2801 i_val=dft_control%rtp_control%initial_wfn)
2803 l_val=dft_control%rtp_control%hfx_redistribute)
2805 l_val=dft_control%rtp_control%apply_wfn_mix_init_restart)
2807 l_val=dft_control%rtp_control%apply_delta_pulse)
2809 l_val=dft_control%rtp_control%apply_delta_pulse_mag)
2811 l_val=dft_control%rtp_control%velocity_gauge)
2813 l_val=dft_control%rtp_control%nl_gauge_transform)
2815 l_val=dft_control%rtp_control%periodic)
2817 l_val=dft_control%rtp_control%linear_scaling)
2819 i_val=dft_control%rtp_control%mcweeny_max_iter)
2821 i_val=dft_control%rtp_control%acc_ref)
2823 r_val=dft_control%rtp_control%mcweeny_eps)
2825 r_val=dft_control%rtp_control%delta_pulse_scale)
2828 dft_control%rtp_control%delta_pulse_direction = tmp
2830 i_val=dft_control%rtp_control%sc_check_start)
2833 IF (is_present)
THEN
2834 IF (dft_control%rtp_control%linear_scaling) &
2835 CALL cp_abort(__location__, &
2836 "You have defined a time dependent projection of mos, but "// &
2837 "only the density matrix is propagated (DENSITY_PROPAGATION "// &
2838 ".TRUE.). Please either use MO-based real time DFT or do not "// &
2839 "define any PRINT%PROJECTION_MO section")
2840 dft_control%rtp_control%is_proj_mo = .true.
2842 dft_control%rtp_control%is_proj_mo = .false.
2845 END SUBROUTINE read_rtp_section
2852 SUBROUTINE read_admm_block_list(admm_control, dft_section)
2856 INTEGER :: irep, list_size, n_rep
2857 INTEGER,
DIMENSION(:),
POINTER :: tmplist
2864 ALLOCATE (admm_control%blocks(n_rep))
2868 i_rep_val=irep, i_vals=tmplist)
2869 list_size =
SIZE(tmplist)
2870 ALLOCATE (admm_control%blocks(irep)%list(list_size))
2871 admm_control%blocks(irep)%list(:) = tmplist(:)
2874 END SUBROUTINE read_admm_block_list
2883 SUBROUTINE read_hairy_probes_sections(dft_control, hairy_probes_section)
2887 INTEGER :: i, j, jj, kk, n_rep
2888 INTEGER,
DIMENSION(:),
POINTER :: tmplist
2890 DO i = 1,
SIZE(dft_control%probe)
2891 NULLIFY (dft_control%probe(i)%atom_ids)
2896 CALL section_vals_val_get(hairy_probes_section,
"ATOM_IDS", i_rep_section=i, i_rep_val=kk, i_vals=tmplist)
2897 jj = jj +
SIZE(tmplist)
2900 dft_control%probe(i)%natoms = jj
2901 IF (dft_control%probe(i)%natoms < 1) &
2902 cpabort(
"Need at least 1 atom to use hair probes formalism")
2903 ALLOCATE (dft_control%probe(i)%atom_ids(dft_control%probe(i)%natoms))
2907 CALL section_vals_val_get(hairy_probes_section,
"ATOM_IDS", i_rep_section=i, i_rep_val=kk, i_vals=tmplist)
2908 DO j = 1,
SIZE(tmplist)
2910 dft_control%probe(i)%atom_ids(jj) = tmplist(j)
2914 CALL section_vals_val_get(hairy_probes_section,
"MU", i_rep_section=i, r_val=dft_control%probe(i)%mu)
2916 CALL section_vals_val_get(hairy_probes_section,
"T", i_rep_section=i, r_val=dft_control%probe(i)%T)
2918 CALL section_vals_val_get(hairy_probes_section,
"ALPHA", i_rep_section=i, r_val=dft_control%probe(i)%alpha)
2920 CALL section_vals_val_get(hairy_probes_section,
"eps_hp", i_rep_section=i, r_val=dft_control%probe(i)%eps_hp)
2923 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 yin2017
integer, save, public stewart2007
integer, save, public caldeweyher2020
integer, save, public stengel2009
integer, save, public vandevondele2005a
integer, save, public caldeweyher2017
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 asgeirsson2017
integer, save, public rocha2006
integer, save, public lippert1997
integer, save, public fattebert2002
integer, save, public thiel1992
integer, save, public pracht2019
integer, save, public porezag1995
integer, save, public bannwarth2019
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
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 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_tddfpt2_control(t_control, t_section, qs_control)
Read TDDFPT-related input parameters.
subroutine, public read_dft_control(dft_control, dft_section)
...
subroutine, public read_qs_section(qs_control, qs_section)
...
subroutine, public write_admm_control(admm_control, dft_section)
Write the ADMM control parameters to the output unit.
subroutine, public write_dft_control(dft_control, dft_section)
Write the DFT control parameters to the output unit.
subroutine, public read_ddapc_section(qs_control, qs_section, ddapc_restraint_section)
reads the input parameters needed for ddapc.
subroutine, public read_mgrid_section(qs_control, dft_section)
...
Utility routines to open and close files. Tracking of preconnections.
subroutine, public open_file(file_name, file_status, file_form, file_action, file_position, file_pad, unit_number, debug, skip_get_unit_number, file_access)
Opens the requested file using a free unit number.
subroutine, public close_file(unit_number, file_status, keep_preconnection)
Close an open file given by its logical unit number. Optionally, keep the file and unit preconnected.
various routines to log and control the output. The idea is that decisions about where to log should ...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
Utility routines to read data from files. Kept as close as possible to the old parser because.
subroutine, public parser_read_line(parser, nline, at_end)
Read the next line from a logical unit "unit" (I/O node only). Skip (nline-1) lines and skip also all...
Utility routines to read data from files. Kept as close as possible to the old parser because.
subroutine, public parser_reset(parser)
Resets the parser: rewinding the unit and re-initializing all parser structures.
subroutine, public parser_release(parser)
releases the parser
subroutine, public parser_create(parser, file_name, unit_nr, para_env, end_section_label, separator_chars, comment_char, continuation_char, quote_char, section_char, parse_white_lines, initial_variables, apply_preprocessing)
Start a parser run. Initial variables allow to @SET stuff before opening the file.
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, quip, nequip, allegro, bmhft, bmhftd, ipbv, buck4r, buckmo, gp, tersoff, siepmann, gal, gal21, tab, deepmd, ace)
Cleans the potential parameter type.
Periodic Table related data definitions.
subroutine, public get_ptable_info(symbol, number, amass, ielement, covalent_radius, metallic_radius, vdw_radius, found)
Pass information about the kind given the element symbol.
Utility subroutines for CDFT calculations.
subroutine, public read_cdft_control_section(qs_control, cdft_control_section)
reads the input parameters needed for CDFT with OT
Input control types for NEGF/SMEAGOL transport calculations.
subroutine, public read_smeagol_control(smeagol_control, smeagol_section)
Read SMEAGOL-related input parameters.
Utilities for string manipulations.
elemental subroutine, public uppercase(string)
Convert all lower case characters in a string to upper case.
All kind of helpful little routines.
Define XAS TDP control type and associated create, release, etc subroutines, as well as XAS TDP envir...
subroutine, public read_xas_tdp_control(xas_tdp_control, xas_tdp_section)
Reads the inputs and stores in xas_tdp_control_type.
Writes information on XC functionals to output.
subroutine, public xc_write(iounit, xc_section, lsd)
...
Exchange and Correlation functional calculations.
logical function, public xc_uses_norm_drho(xc_fun_section, lsd)
...
logical function, public xc_uses_kinetic_energy_density(xc_fun_section, lsd)
...
type of a logger, at the moment it contains just a print level starting at which level it should be l...