83#include "./base/base_uses.f90"
89 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'cp_control_utils'
110 CHARACTER(len=default_path_length) :: basis_set_file_name, &
111 intensities_file_name, &
113 CHARACTER(LEN=default_string_length), &
114 DIMENSION(:),
POINTER :: tmpstringlist
115 INTEGER :: admmtype, irep, isize, method_id, nrep, &
117 LOGICAL :: at_end, do_hfx, do_ot, do_rpa_admm, &
118 do_rtp, exopt1, exopt2, exopt3, &
119 explicit, is_present, l_param, not_se, &
121 REAL(kind=
dp) :: density_cut, gradient_cut, tau_cut
122 REAL(kind=
dp),
DIMENSION(:),
POINTER :: pol
126 sccs_section, scf_section, &
127 tmp_section, xc_fun_section, xc_section
129 was_present = .false.
133 NULLIFY (tmp_section, xc_fun_section, xc_section)
134 ALLOCATE (dft_control)
140 SELECT CASE (method_id)
148 IF (.NOT. is_present .AND. not_se)
THEN
149 cpabort(
"XC section missing.")
156 IF (density_cut <= epsilon(0.0_dp)*100.0_dp) &
157 CALL cp_warn(__location__, &
158 "DENSITY_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
159 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
160 density_cut = max(epsilon(0.0_dp)*100.0_dp, density_cut)
161 IF (gradient_cut <= epsilon(0.0_dp)*100.0_dp) &
162 CALL cp_warn(__location__, &
163 "GRADIENT_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
164 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
165 gradient_cut = max(epsilon(0.0_dp)*100.0_dp, gradient_cut)
166 IF (tau_cut <= epsilon(0.0_dp)*100.0_dp) &
167 CALL cp_warn(__location__, &
168 "TAU_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
169 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
170 tau_cut = max(epsilon(0.0_dp)*100.0_dp, tau_cut)
177 IF (.NOT. is_present .AND. not_se)
THEN
178 cpabort(
"XC_FUNCTIONAL section missing.")
183 IF (dft_control%uks .OR. dft_control%roks)
THEN
184 dft_control%nspins = 2
186 dft_control%nspins = 1
189 dft_control%lsd = (dft_control%nspins > 1)
193 dft_control%drho_by_collocation = (
xc_uses_norm_drho(xc_fun_section, dft_control%lsd) &
195 IF (dft_control%drho_by_collocation)
THEN
196 cpabort(
"derivatives by collocation not implemented")
203 IF (
SIZE(tmpstringlist) == 2)
THEN
205 SELECT CASE (tmpstringlist(2))
217 cpwarn(
"Unknown basis size in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
220 SELECT CASE (tmpstringlist(1))
223 dft_control%auto_basis_ri_aux = isize
225 dft_control%auto_basis_aux_fit = isize
227 dft_control%auto_basis_lri_aux = isize
229 dft_control%auto_basis_p_lri_aux = isize
231 dft_control%auto_basis_ri_hxc = isize
233 dft_control%auto_basis_ri_xas = isize
235 dft_control%auto_basis_ri_hfx = isize
237 cpwarn(
"Unknown basis type in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
240 CALL cp_abort(__location__, &
241 "AUTO_BASIS keyword in &DFT section has a wrong number of arguments.")
252 is_present = is_present .AND. (do_hfx .OR. do_rpa_admm)
254 dft_control%do_admm = is_present
255 dft_control%do_admm_mo = .false.
256 dft_control%do_admm_dm = .false.
262 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_TYPE", i_val=admmtype)
263 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", explicit=exopt1)
264 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%METHOD", explicit=exopt2)
265 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_SCALING_MODEL", explicit=exopt3)
266 dft_control%admm_control%admm_type = admmtype
267 SELECT CASE (admmtype)
269 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", i_val=method_id)
270 dft_control%admm_control%purification_method = method_id
271 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%METHOD", i_val=method_id)
272 dft_control%admm_control%method = method_id
273 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_SCALING_MODEL", i_val=method_id)
274 dft_control%admm_control%scaling_model = method_id
279 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", i_val=method_id)
280 dft_control%admm_control%purification_method = method_id
312 CALL cp_abort(__location__, &
313 "ADMM_TYPE keyword in &AUXILIARY_DENSITY_MATRIX_METHOD section has a wrong value.")
317 r_val=dft_control%admm_control%eps_filter)
319 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_CORRECTION_FUNC", i_val=method_id)
320 dft_control%admm_control%aux_exch_func = method_id
323 dft_control%admm_control%aux_exch_func_param = .false.
324 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_A1", explicit=explicit, &
325 r_val=dft_control%admm_control%aux_x_param(1))
326 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
327 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_A2", explicit=explicit, &
328 r_val=dft_control%admm_control%aux_x_param(2))
329 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
330 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_GAMMA", explicit=explicit, &
331 r_val=dft_control%admm_control%aux_x_param(3))
332 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
334 CALL read_admm_block_list(dft_control%admm_control, dft_section)
337 SELECT CASE (admmtype)
339 IF (exopt2)
CALL cp_warn(__location__, &
340 "Value of ADMM_PURIFICATION_METHOD keyword will be overwritten with ADMM_TYPE selections.")
341 IF (exopt3)
CALL cp_warn(__location__, &
342 "Value of EXCH_SCALING_MODEL keyword will be overwritten with ADMM_TYPE selections.")
344 IF (exopt1)
CALL cp_warn(__location__, &
345 "Value of METHOD keyword will be overwritten with ADMM_TYPE selections.")
346 IF (exopt2)
CALL cp_warn(__location__, &
347 "Value of METHOD keyword will be overwritten with ADMM_TYPE selections.")
348 IF (exopt3)
CALL cp_warn(__location__, &
349 "Value of EXCH_SCALING_MODEL keyword will be overwritten with ADMM_TYPE selections.")
358 cpabort(
"ADMM: Blocking and Merlot scaling are mutually exclusive.")
363 CALL cp_abort(__location__, &
364 "ADMM: In the case of METHOD=CHARGE_CONSTRAINED_PROJECTION, "// &
365 "ADMM_PURIFICATION_METHOD=NONE has to be set.")
371 cpabort(
"ADMM: Chosen purification requires BASIS_PROJECTION")
373 IF (.NOT. do_ot) cpabort(
"ADMM: MO-based purification requires OT.")
378 dft_control%do_admm_dm = .true.
380 dft_control%do_admm_mo = .true.
388 dft_control%restricted = (dft_control%roks .AND. l_param)
392 CALL section_vals_val_get(dft_section,
"RELAX_MULTIPLICITY", r_val=dft_control%relax_multiplicity)
393 IF (dft_control%relax_multiplicity > 0.0_dp)
THEN
394 IF (.NOT. dft_control%uks) &
395 CALL cp_abort(__location__,
"The option RELAX_MULTIPLICITY is only valid for "// &
396 "unrestricted Kohn-Sham (UKS) calculations")
403 dft_control%sic_method_id =
sic_none
404 dft_control%sic_scaling_a = 1.0_dp
405 dft_control%sic_scaling_b = 1.0_dp
408 dft_control%dft_plus_u = .false.
410 dft_control%plus_u_method_id = method_id
413 dft_control%smear = .false.
416 dft_control%correct_surf_dip = .false.
417 CALL section_vals_val_get(dft_section,
"SURFACE_DIPOLE_CORRECTION", l_val=dft_control%correct_surf_dip)
419 dft_control%pos_dir_surf_dip = -1.0_dp
423 dft_control%switch_surf_dip = .false.
424 dft_control%surf_dip_correct_switch = dft_control%correct_surf_dip
426 dft_control%correct_el_density_dip = .false.
427 CALL section_vals_val_get(dft_section,
"CORE_CORR_DIP", l_val=dft_control%correct_el_density_dip)
428 IF (dft_control%correct_el_density_dip)
THEN
429 IF (dft_control%correct_surf_dip)
THEN
432 dft_control%correct_el_density_dip = .false.
433 cpwarn(
"CORE_CORR_DIP keyword is activated only if SURFACE_DIPOLE_CORRECTION is TRUE")
438 c_val=basis_set_file_name)
440 c_val=potential_file_name)
445 i_val=dft_control%sic_method_id)
447 i_val=dft_control%sic_list_id)
449 r_val=dft_control%sic_scaling_a)
451 r_val=dft_control%sic_scaling_b)
457 CALL read_rtp_section(dft_control, tmp_section)
464 IF (dft_control%do_xas_calculation)
THEN
467 l_val=dft_control%do_xas_calculation)
471 CALL section_vals_get(tmp_section, explicit=dft_control%do_xas_tdp_calculation)
472 IF (dft_control%do_xas_tdp_calculation)
THEN
475 l_val=dft_control%do_xas_tdp_calculation)
479 dft_control%apply_efield = .false.
480 dft_control%apply_efield_field = .false.
481 dft_control%apply_vector_potential = .false.
485 ALLOCATE (dft_control%efield_fields(nrep))
486 CALL read_efield_sections(dft_control, tmp_section)
488 IF (.NOT. dft_control%rtp_control%velocity_gauge)
THEN
489 dft_control%apply_efield_field = .true.
491 dft_control%apply_vector_potential = .true.
493 dft_control%rtp_control%vec_pot = dft_control%efield_fields(1)%efield%vec_pot_initial
496 dft_control%apply_efield = .true.
503 CALL section_vals_get(tmp_section, explicit=dft_control%apply_period_efield)
504 IF (dft_control%apply_period_efield)
THEN
505 ALLOCATE (dft_control%period_efield)
507 dft_control%period_efield%polarisation(1:3) = pol(1:3)
509 dft_control%period_efield%d_filter(1:3) = pol(1:3)
511 r_val=dft_control%period_efield%strength)
512 dft_control%period_efield%displacement_field = .false.
514 l_val=dft_control%period_efield%displacement_field)
520 IF (
SIZE(pol) > 1 .OR. pol(1) /= 0.0_dp)
THEN
522 IF (dft_control%period_efield%strength /= 0.0_dp .OR. intensities_file_name /=
"")
THEN
523 CALL cp_abort(__location__,
"[PERIODIC FIELD] Only one of INTENSITY, INTENSITY_LIST "// &
524 "or INTENSITIES_FILE_NAME can be specified.")
527 ALLOCATE (dft_control%period_efield%strength_list(
SIZE(pol)))
528 dft_control%period_efield%strength_list(1:
SIZE(pol)) = pol(1:
SIZE(pol))
531 IF (intensities_file_name /=
"")
THEN
533 IF (dft_control%period_efield%strength /= 0.0_dp)
THEN
534 CALL cp_abort(__location__,
"[PERIODIC FIELD] Only one of INTENSITY, INTENSITY_LIST "// &
535 "or INTENSITIES_FILE_NAME can be specified.")
548 cpabort(
"[PERIODIC FIELD] No intensities found in INTENSITIES_FILE_NAME")
551 ALLOCATE (dft_control%period_efield%strength_list(nrep))
556 READ (parser%input_line, *) dft_control%period_efield%strength_list(irep)
563 i_val=dft_control%period_efield%start_frame)
565 i_val=dft_control%period_efield%end_frame)
567 IF (dft_control%period_efield%end_frame /= -1)
THEN
571 IF (dft_control%period_efield%start_frame > dft_control%period_efield%end_frame)
THEN
572 cpabort(
"[PERIODIC FIELD] START_FRAME > END_FRAME")
573 ELSE IF (dft_control%period_efield%start_frame < 1)
THEN
574 cpabort(
"[PERIODIC FIELD] START_FRAME < 1")
575 ELSE IF (mod(dft_control%period_efield%end_frame - &
576 dft_control%period_efield%start_frame + 1,
SIZE(pol)) /= 0)
THEN
577 CALL cp_abort(__location__, &
578 "[PERIODIC FIELD] Number of active frames must be a multiple of the number of intensities")
583 cpassert(.NOT. do_rtp)
584 IF (dft_control%period_efield%displacement_field)
THEN
594 CALL section_vals_get(tmp_section, explicit=dft_control%apply_external_potential)
595 IF (dft_control%apply_external_potential)
THEN
598 l_val=dft_control%expot_control%read_from_cube)
600 l_val=dft_control%expot_control%static)
602 r_val=dft_control%expot_control%scaling_factor)
607 dft_control%expot_control%maxwell_solver = .true.
611 r_val=dft_control%maxwell_control%real_test)
613 i_val=dft_control%maxwell_control%int_test)
615 l_val=dft_control%maxwell_control%log_test)
617 dft_control%expot_control%maxwell_solver = .false.
627 l_val=dft_control%do_sccs)
628 IF (dft_control%do_sccs)
THEN
629 ALLOCATE (dft_control%sccs_control)
631 r_val=dft_control%sccs_control%epsilon_solvent)
633 r_val=dft_control%sccs_control%alpha_solvent)
635 r_val=dft_control%sccs_control%beta_solvent)
637 r_val=dft_control%sccs_control%delta_rho)
639 i_val=dft_control%sccs_control%derivative_method)
641 i_val=dft_control%sccs_control%method_id)
643 r_val=dft_control%sccs_control%eps_sccs)
645 r_val=dft_control%sccs_control%eps_scf)
647 r_val=dft_control%sccs_control%gamma_solvent)
649 i_val=dft_control%sccs_control%max_iter)
651 r_val=dft_control%sccs_control%mixing)
652 SELECT CASE (dft_control%sccs_control%method_id)
656 r_val=dft_control%sccs_control%rho_max)
658 r_val=dft_control%sccs_control%rho_min)
659 IF (dft_control%sccs_control%rho_max < dft_control%sccs_control%rho_min)
THEN
660 CALL cp_abort(__location__, &
661 "The SCCS parameter RHO_MAX is smaller than RHO_MIN. "// &
662 "Please, check your input!")
668 r_val=dft_control%sccs_control%beta)
669 IF (dft_control%sccs_control%beta < 0.5_dp)
THEN
670 CALL cp_abort(__location__, &
671 "A value smaller than 0.5 for the SCCS parameter beta "// &
672 "causes numerical problems. Please, check your input!")
675 r_val=dft_control%sccs_control%rho_zero)
678 cpabort(
"Invalid SCCS model specified. Please, check your input!")
687 CALL section_vals_get(tmp_section, explicit=dft_control%apply_external_density)
709 CHARACTER(len=*),
PARAMETER :: routinen =
'read_mgrid_section'
711 INTEGER :: handle, igrid_level, ngrid_level
712 LOGICAL :: explicit, multigrid_set
714 REAL(
dp),
DIMENSION(:),
POINTER :: cutofflist
717 CALL timeset(routinen, handle)
719 NULLIFY (mgrid_section, cutofflist)
725 CALL section_vals_val_get(mgrid_section,
"PROGRESSION_FACTOR", r_val=qs_control%progression_factor)
730 l_val=qs_control%skip_load_balance_distributed)
733 IF (qs_control%semi_empirical .OR. qs_control%dftb .OR. qs_control%xtb)
THEN
735 multigrid_set = .false.
738 IF (.NOT. explicit) cutoff = 1.0_dp
741 ALLOCATE (qs_control%e_cutoff(ngrid_level))
742 qs_control%cutoff = cutoff
744 IF (multigrid_set)
THEN
746 IF (qs_control%commensurate_mgrids)
THEN
747 cpabort(
"Do not specify cutoffs for the commensurate grids (NYI)")
751 IF (
ASSOCIATED(cutofflist))
THEN
752 IF (
SIZE(cutofflist, 1) /= ngrid_level)
THEN
753 cpabort(
"Number of multi-grids requested and number of cutoff values do not match")
755 DO igrid_level = 1, ngrid_level
756 qs_control%e_cutoff(igrid_level) = cutofflist(igrid_level)
760 DO igrid_level = ngrid_level, 1, -1
761 IF (qs_control%cutoff <= qs_control%e_cutoff(igrid_level))
THEN
762 qs_control%cutoff = qs_control%e_cutoff(igrid_level)
766 IF (igrid_level == 1)
THEN
767 qs_control%cutoff = qs_control%e_cutoff(1)
771 IF (qs_control%commensurate_mgrids) qs_control%progression_factor = 4.0_dp
772 qs_control%e_cutoff(1) = qs_control%cutoff
773 DO igrid_level = 2, ngrid_level
774 qs_control%e_cutoff(igrid_level) = qs_control%e_cutoff(igrid_level - 1)/ &
775 qs_control%progression_factor
779 DO igrid_level = 2, ngrid_level
780 IF (qs_control%e_cutoff(igrid_level) > qs_control%e_cutoff(igrid_level - 1))
THEN
781 cpabort(
"The cutoff values for the multi-grids are not ordered from large to small")
782 ELSE IF (qs_control%e_cutoff(igrid_level) == qs_control%e_cutoff(igrid_level - 1))
THEN
783 cpabort(
"The same cutoff value was specified for two multi-grids")
786 CALL timestop(handle)
799 CHARACTER(len=*),
PARAMETER :: routinen =
'read_qs_section'
801 CHARACTER(LEN=default_string_length) :: cval
802 CHARACTER(LEN=default_string_length), &
803 DIMENSION(:),
POINTER :: clist
804 INTEGER :: handle, itmp, j, jj, k, n_rep, n_var, &
806 INTEGER,
DIMENSION(:),
POINTER :: tmplist
807 LOGICAL :: explicit, was_present
808 REAL(
dp) :: tmp, tmpsqrt, value
809 REAL(
dp),
POINTER :: scal(:)
810 TYPE(
section_vals_type),
POINTER :: cdft_control_section, ddapc_restraint_section, &
811 dftb_parameter, dftb_section, eeq_section, genpot_section, lri_optbas_section, &
812 mull_section, nonbonded_section, s2_restraint_section, se_section, xtb_parameter, &
815 CALL timeset(routinen, handle)
817 was_present = .false.
818 NULLIFY (mull_section, ddapc_restraint_section, s2_restraint_section, &
819 se_section, dftb_section, xtb_section, dftb_parameter, xtb_parameter, lri_optbas_section, &
820 cdft_control_section, genpot_section, eeq_section)
839 tmpsqrt = sqrt(
value)
842 qs_control%eps_core_charge =
value/100.0_dp
845 qs_control%eps_pgf_orb = tmpsqrt
846 qs_control%eps_kg_orb = qs_control%eps_pgf_orb
848 qs_control%eps_ppnl = qs_control%eps_pgf_orb/100.0_dp
850 qs_control%eps_ppl = 1.0e-2_dp
852 qs_control%gapw_control%eps_cpc =
value
854 qs_control%eps_rho_gspace =
value
855 qs_control%eps_rho_rspace =
value
857 qs_control%eps_gvg_rspace = tmpsqrt
874 qs_control%eps_kg_orb = sqrt(tmp)
887 qs_control%eps_rho_rspace = qs_control%eps_rho_gspace
911 qs_control%gapw_control%lrho1_eq_lrho0 = .false.
912 qs_control%gapw_control%alpha0_hard_from_input = .false.
913 IF (qs_control%gapw_control%alpha0_hard /= 0.0_dp) qs_control%gapw_control%alpha0_hard_from_input = .true.
915 CALL section_vals_val_get(qs_section,
"MAX_RAD_LOCAL", r_val=qs_control%gapw_control%max_rad_local)
925 CALL section_vals_val_get(qs_section,
"CLUSTER_EMBED_SUBSYS", l_val=qs_control%cluster_embed_subsys)
926 CALL section_vals_val_get(qs_section,
"HIGH_LEVEL_EMBED_SUBSYS", l_val=qs_control%high_level_embed_subsys)
937 IF (qs_control%gapw_control%basis_1c /=
gapw_1c_orb)
THEN
938 qs_control%gapw_control%eps_svd = max(qs_control%gapw_control%eps_svd, 1.e-12_dp)
945 qs_control%pw_grid_opt%spherical = .true.
946 qs_control%pw_grid_opt%fullspace = .false.
948 qs_control%pw_grid_opt%spherical = .false.
949 qs_control%pw_grid_opt%fullspace = .true.
951 qs_control%pw_grid_opt%spherical = .false.
952 qs_control%pw_grid_opt%fullspace = .false.
957 qs_control%do_ppl_method = itmp
960 qs_control%pw_grid_opt%distribution_layout = tmplist
964 CALL section_vals_val_get(qs_section,
"EXTRAPOLATION", i_val=qs_control%wf_interpolation_method_nr)
965 CALL section_vals_val_get(qs_section,
"EXTRAPOLATION_ORDER", i_val=qs_control%wf_extrapolation_order)
969 qs_control%gapw = .false.
970 qs_control%gapw_xc = .false.
971 qs_control%gpw = .false.
972 qs_control%pao = .false.
973 qs_control%dftb = .false.
974 qs_control%xtb = .false.
975 qs_control%semi_empirical = .false.
976 qs_control%ofgpw = .false.
977 qs_control%lrigpw = .false.
978 qs_control%rigpw = .false.
979 SELECT CASE (qs_control%method_id)
983 qs_control%gapw = .true.
985 qs_control%gapw_xc = .true.
989 qs_control%gpw = .true.
991 qs_control%ofgpw = .true.
993 qs_control%lrigpw = .true.
995 qs_control%rigpw = .true.
997 qs_control%dftb = .true.
1001 qs_control%xtb = .true.
1006 qs_control%semi_empirical = .true.
1009 qs_control%semi_empirical = .true.
1012 qs_control%semi_empirical = .true.
1015 qs_control%semi_empirical = .true.
1018 qs_control%semi_empirical = .true.
1021 qs_control%semi_empirical = .true.
1024 qs_control%semi_empirical = .true.
1027 qs_control%semi_empirical = .true.
1031 qs_control%semi_empirical = .true.
1034 CALL section_vals_get(mull_section, explicit=qs_control%mulliken_restraint)
1036 IF (qs_control%mulliken_restraint)
THEN
1037 CALL section_vals_val_get(mull_section,
"STRENGTH", r_val=qs_control%mulliken_restraint_control%strength)
1038 CALL section_vals_val_get(mull_section,
"TARGET", r_val=qs_control%mulliken_restraint_control%target)
1043 jj = jj +
SIZE(tmplist)
1045 qs_control%mulliken_restraint_control%natoms = jj
1046 IF (qs_control%mulliken_restraint_control%natoms < 1) &
1047 cpabort(
"Need at least 1 atom to use mulliken constraints")
1048 ALLOCATE (qs_control%mulliken_restraint_control%atoms(qs_control%mulliken_restraint_control%natoms))
1052 DO j = 1,
SIZE(tmplist)
1054 qs_control%mulliken_restraint_control%atoms(jj) = tmplist(j)
1058 CALL section_vals_get(ddapc_restraint_section, n_repetition=nrep, explicit=qs_control%ddapc_restraint)
1059 IF (qs_control%ddapc_restraint)
THEN
1060 ALLOCATE (qs_control%ddapc_restraint_control(nrep))
1062 qs_control%ddapc_restraint_is_spin = .false.
1063 qs_control%ddapc_explicit_potential = .false.
1066 CALL section_vals_get(s2_restraint_section, explicit=qs_control%s2_restraint)
1067 IF (qs_control%s2_restraint)
THEN
1069 r_val=qs_control%s2_restraint_control%strength)
1071 r_val=qs_control%s2_restraint_control%target)
1073 i_val=qs_control%s2_restraint_control%functional_form)
1077 IF (qs_control%cdft)
THEN
1082 IF (qs_control%semi_empirical)
THEN
1084 l_val=qs_control%se_control%orthogonal_basis)
1086 r_val=qs_control%se_control%delta)
1088 l_val=qs_control%se_control%analytical_gradients)
1090 l_val=qs_control%se_control%force_kdsod_EX)
1093 i_val=qs_control%se_control%integral_screening)
1096 CALL cp_warn(__location__, &
1097 "PNNL semi-empirical parameterization supports only the Slater type "// &
1098 "integral scheme. Revert to Slater and continue the calculation.")
1103 i_val=qs_control%se_control%ga_ncells)
1106 r_val=qs_control%se_control%cutoff_lrc)
1107 qs_control%se_control%taper_lrc = qs_control%se_control%cutoff_lrc
1112 r_val=qs_control%se_control%taper_lrc)
1115 r_val=qs_control%se_control%range_lrc)
1118 r_val=qs_control%se_control%cutoff_cou)
1119 qs_control%se_control%taper_cou = qs_control%se_control%cutoff_cou
1124 r_val=qs_control%se_control%taper_cou)
1127 r_val=qs_control%se_control%range_cou)
1130 r_val=qs_control%se_control%cutoff_exc)
1131 qs_control%se_control%taper_exc = qs_control%se_control%cutoff_exc
1136 r_val=qs_control%se_control%taper_exc)
1139 r_val=qs_control%se_control%range_exc)
1143 r_val=qs_control%se_control%taper_scr)
1145 r_val=qs_control%se_control%range_scr)
1149 i_val=qs_control%se_control%periodic_type)
1150 SELECT CASE (qs_control%se_control%periodic_type)
1152 qs_control%se_control%do_ewald = .false.
1153 qs_control%se_control%do_ewald_r3 = .false.
1154 qs_control%se_control%do_ewald_gks = .false.
1156 qs_control%se_control%do_ewald = .true.
1157 qs_control%se_control%do_ewald_r3 = .false.
1158 qs_control%se_control%do_ewald_gks = .false.
1160 qs_control%se_control%do_ewald = .false.
1161 qs_control%se_control%do_ewald_r3 = .false.
1162 qs_control%se_control%do_ewald_gks = .true.
1164 CALL cp_abort(__location__, &
1165 "A periodic semi-empirical calculation was requested with a long-range "// &
1166 "summation on the single integral evaluation. This scheme is supported "// &
1167 "only by the PNNL parameterization.")
1169 qs_control%se_control%do_ewald = .true.
1170 qs_control%se_control%do_ewald_r3 = .true.
1171 qs_control%se_control%do_ewald_gks = .false.
1172 IF (qs_control%se_control%integral_screening /=
do_se_is_kdso) &
1173 CALL cp_abort(__location__, &
1174 "A periodic semi-empirical calculation was requested with a long-range "// &
1175 "summation for the slowly convergent part 1/R^3, which is not congruent "// &
1176 "with the integral screening chosen. The only integral screening supported "// &
1177 "by this periodic type calculation is the standard Klopman-Dewar-Sabelli-Ohno.")
1182 l_val=qs_control%se_control%dispersion)
1184 r_val=qs_control%se_control%rcdisp)
1186 r_val=qs_control%se_control%epscn)
1188 qs_control%se_control%sd3(1) = scal(1)
1189 qs_control%se_control%sd3(2) = scal(2)
1190 qs_control%se_control%sd3(3) = scal(3)
1192 c_val=qs_control%se_control%dispersion_parameter_file)
1196 cpabort(
"EWALD_R3 not implemented yet!")
1208 qs_control%se_control%orthogonal_basis = .true.
1213 IF (qs_control%dftb)
THEN
1215 l_val=qs_control%dftb_control%orthogonal_basis)
1217 l_val=qs_control%dftb_control%self_consistent)
1219 l_val=qs_control%dftb_control%dispersion)
1221 l_val=qs_control%dftb_control%dftb3_diagonal)
1223 l_val=qs_control%dftb_control%hb_sr_damp)
1225 r_val=qs_control%dftb_control%eps_disp)
1229 l_val=qs_control%dftb_control%do_ewald)
1231 qs_control%dftb_control%do_ewald = (qs_control%periodicity /= 0)
1234 c_val=qs_control%dftb_control%sk_file_path)
1236 c_val=qs_control%dftb_control%sk_file_list)
1238 r_val=qs_control%dftb_control%hb_sr_para)
1240 ALLOCATE (qs_control%dftb_control%sk_pair_list(3, n_var))
1244 qs_control%dftb_control%sk_pair_list(1:3, k) = clist(1:3)
1248 i_val=qs_control%dftb_control%dispersion_type)
1250 c_val=qs_control%dftb_control%uff_force_field)
1253 r_val=qs_control%dftb_control%rcdisp)
1255 r_val=qs_control%dftb_control%epscn)
1257 r_val=qs_control%dftb_control%exp_pre)
1259 r_val=qs_control%dftb_control%scaling)
1261 qs_control%dftb_control%sd3(1) = scal(1)
1262 qs_control%dftb_control%sd3(2) = scal(2)
1263 qs_control%dftb_control%sd3(3) = scal(3)
1265 qs_control%dftb_control%sd3bj(1) = scal(1)
1266 qs_control%dftb_control%sd3bj(2) = scal(2)
1267 qs_control%dftb_control%sd3bj(3) = scal(3)
1268 qs_control%dftb_control%sd3bj(4) = scal(4)
1270 c_val=qs_control%dftb_control%dispersion_parameter_file)
1272 IF (qs_control%dftb_control%dispersion)
CALL cite_reference(
zhechkov2005)
1273 IF (qs_control%dftb_control%self_consistent)
CALL cite_reference(
elstner1998)
1274 IF (qs_control%dftb_control%hb_sr_damp)
CALL cite_reference(
hu2007)
1278 IF (qs_control%xtb)
THEN
1283 l_val=qs_control%xtb_control%do_ewald)
1285 qs_control%xtb_control%do_ewald = (qs_control%periodicity /= 0)
1303 SELECT CASE (qs_control%xtb_control%gfn_type)
1310 cpabort(
"gfn2-xtb tbd")
1317 qs_control%xtb_control%sto_ng = ngauss
1319 qs_control%xtb_control%h_sto_ng = ngauss
1321 c_val=qs_control%xtb_control%parameter_file_path)
1325 c_val=qs_control%xtb_control%parameter_file_name)
1327 SELECT CASE (qs_control%xtb_control%gfn_type)
1329 qs_control%xtb_control%parameter_file_name =
"xTB0_parameters"
1331 qs_control%xtb_control%parameter_file_name =
"xTB1_parameters"
1333 cpabort(
"gfn2-xtb tbd")
1340 r_val=qs_control%xtb_control%rcdisp)
1342 r_val=qs_control%xtb_control%epscn)
1346 qs_control%xtb_control%s6 = scal(1)
1347 qs_control%xtb_control%s8 = scal(2)
1349 SELECT CASE (qs_control%xtb_control%gfn_type)
1351 qs_control%xtb_control%s6 = 1.00_dp
1352 qs_control%xtb_control%s8 = 2.85_dp
1354 qs_control%xtb_control%s6 = 1.00_dp
1355 qs_control%xtb_control%s8 = 2.40_dp
1357 cpabort(
"gfn2-xtb tbd")
1365 qs_control%xtb_control%a1 = scal(1)
1366 qs_control%xtb_control%a2 = scal(2)
1368 SELECT CASE (qs_control%xtb_control%gfn_type)
1370 qs_control%xtb_control%a1 = 0.80_dp
1371 qs_control%xtb_control%a2 = 4.60_dp
1373 qs_control%xtb_control%a1 = 0.63_dp
1374 qs_control%xtb_control%a2 = 5.00_dp
1376 cpabort(
"gfn2-xtb tbd")
1382 c_val=qs_control%xtb_control%dispersion_parameter_file)
1387 qs_control%xtb_control%ks = scal(1)
1388 qs_control%xtb_control%kp = scal(2)
1389 qs_control%xtb_control%kd = scal(3)
1390 qs_control%xtb_control%ksp = scal(4)
1391 qs_control%xtb_control%k2sh = scal(5)
1392 IF (qs_control%xtb_control%gfn_type == 0)
THEN
1394 qs_control%xtb_control%ksp = 0.5_dp*(scal(1) + scal(2))
1397 SELECT CASE (qs_control%xtb_control%gfn_type)
1399 qs_control%xtb_control%ks = 2.00_dp
1400 qs_control%xtb_control%kp = 2.4868_dp
1401 qs_control%xtb_control%kd = 2.27_dp
1402 qs_control%xtb_control%ksp = 2.2434_dp
1403 qs_control%xtb_control%k2sh = 1.1241_dp
1405 qs_control%xtb_control%ks = 1.85_dp
1406 qs_control%xtb_control%kp = 2.25_dp
1407 qs_control%xtb_control%kd = 2.00_dp
1408 qs_control%xtb_control%ksp = 2.08_dp
1409 qs_control%xtb_control%k2sh = 2.85_dp
1411 cpabort(
"gfn2-xtb tbd")
1419 qs_control%xtb_control%kg = scal(1)
1420 qs_control%xtb_control%kf = scal(2)
1422 SELECT CASE (qs_control%xtb_control%gfn_type)
1424 qs_control%xtb_control%kg = 2.00_dp
1425 qs_control%xtb_control%kf = 1.50_dp
1427 qs_control%xtb_control%kg = 2.00_dp
1428 qs_control%xtb_control%kf = 1.50_dp
1430 cpabort(
"gfn2-xtb tbd")
1436 qs_control%xtb_control%kcns = scal(1)
1437 qs_control%xtb_control%kcnp = scal(2)
1438 qs_control%xtb_control%kcnd = scal(3)
1443 SELECT CASE (qs_control%xtb_control%gfn_type)
1445 qs_control%xtb_control%ksen = scal(1)
1446 qs_control%xtb_control%kpen = scal(2)
1447 qs_control%xtb_control%kden = scal(3)
1449 qs_control%xtb_control%ken = scal(1)
1451 cpabort(
"gfn2-xtb tbd")
1456 SELECT CASE (qs_control%xtb_control%gfn_type)
1458 qs_control%xtb_control%ksen = 0.006_dp
1459 qs_control%xtb_control%kpen = -0.001_dp
1460 qs_control%xtb_control%kden = -0.002_dp
1462 qs_control%xtb_control%ken = -0.007_dp
1464 cpabort(
"gfn2-xtb tbd")
1471 qs_control%xtb_control%ben = scal(1)
1476 r_val=qs_control%xtb_control%enscale)
1478 SELECT CASE (qs_control%xtb_control%gfn_type)
1480 qs_control%xtb_control%enscale = -0.09_dp
1482 qs_control%xtb_control%enscale = 0._dp
1484 cpabort(
"gfn2-xtb tbd")
1491 l_val=qs_control%xtb_control%xb_interaction)
1493 qs_control%xtb_control%kxr = scal(1)
1494 qs_control%xtb_control%kx2 = scal(2)
1497 l_val=qs_control%xtb_control%do_nonbonded)
1499 IF (explicit .AND. qs_control%xtb_control%do_nonbonded)
THEN
1503 CALL read_gp_section(qs_control%xtb_control%nonbonded, genpot_section, 0)
1507 r_val=qs_control%xtb_control%eps_pair)
1510 qs_control%xtb_control%coulomb_sr_cut = scal(1)
1512 qs_control%xtb_control%coulomb_sr_eps = scal(1)
1518 SELECT CASE (qs_control%xtb_control%gfn_type)
1520 qs_control%xtb_control%coulomb_interaction = .false.
1521 qs_control%xtb_control%coulomb_lr = .false.
1522 qs_control%xtb_control%tb3_interaction = .false.
1523 qs_control%xtb_control%check_atomic_charges = .false.
1525 l_val=qs_control%xtb_control%var_dipole)
1529 l_val=qs_control%xtb_control%coulomb_interaction)
1531 l_val=qs_control%xtb_control%coulomb_lr)
1533 l_val=qs_control%xtb_control%tb3_interaction)
1536 l_val=qs_control%xtb_control%check_atomic_charges)
1537 qs_control%xtb_control%var_dipole = .false.
1539 cpabort(
"gfn2-xtb tbd")
1543 qs_control%xtb_control%kab_nval = n_rep
1545 ALLOCATE (qs_control%xtb_control%kab_param(3, n_rep))
1546 ALLOCATE (qs_control%xtb_control%kab_types(2, n_rep))
1547 ALLOCATE (qs_control%xtb_control%kab_vals(n_rep))
1550 qs_control%xtb_control%kab_param(1, j) = clist(1)
1552 ielement=qs_control%xtb_control%kab_types(1, j))
1553 qs_control%xtb_control%kab_param(2, j) = clist(2)
1555 ielement=qs_control%xtb_control%kab_types(2, j))
1556 qs_control%xtb_control%kab_param(3, j) = clist(3)
1557 READ (clist(3),
'(F10.0)') qs_control%xtb_control%kab_vals(j)
1561 IF (qs_control%xtb_control%gfn_type == 0)
THEN
1563 qs_control%xtb_control%ksrb = scal(1)
1564 qs_control%xtb_control%esrb = scal(2)
1565 qs_control%xtb_control%gscal = scal(3)
1566 qs_control%xtb_control%c1srb = scal(4)
1567 qs_control%xtb_control%c2srb = scal(5)
1568 qs_control%xtb_control%shift = scal(6)
1573 SELECT CASE (trim(cval))
1575 qs_control%xtb_control%enshift_type = 0
1577 qs_control%xtb_control%enshift_type = 1
1579 qs_control%xtb_control%enshift_type = 2
1581 cpabort(
"Unknown value for EN_SHIFT_TYPE")
1585 CALL read_eeq_param(eeq_section, qs_control%xtb_control%eeq_sparam)
1592 CALL timestop(handle)
1606 CHARACTER(LEN=*),
PARAMETER :: routinen =
'read_tddfpt2_control'
1608 CHARACTER(LEN=default_string_length), &
1609 DIMENSION(:),
POINTER :: tmpstringlist
1610 INTEGER :: handle, irep, isize, nrep
1611 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: inds
1612 LOGICAL :: do_ewald, do_exchange, expl, explicit, &
1614 REAL(kind=
dp) :: filter, fval, hfx
1616 soc_section, stda_section, xc_func, &
1619 CALL timeset(routinen, handle)
1634 CALL section_vals_val_get(t_section,
"MIN_AMPLITUDE", r_val=t_control%min_excitation_amplitude)
1641 CALL section_vals_val_get(t_section,
"ADMM_KERNEL_CORRECTION_SYMMETRIC", l_val=t_control%admm_symm)
1642 CALL section_vals_val_get(t_section,
"ADMM_KERNEL_XC_CORRECTION", l_val=t_control%admm_xc_correction)
1643 CALL section_vals_val_get(t_section,
"EXCITON_DESCRIPTORS", l_val=t_control%do_exciton_descriptors)
1644 CALL section_vals_val_get(t_section,
"DIRECTIONAL_EXCITON_DESCRIPTORS", l_val=t_control%do_directional_exciton_descriptors)
1650 IF (
SIZE(tmpstringlist) == 2)
THEN
1652 SELECT CASE (tmpstringlist(2))
1664 cpabort(
"Unknown basis size in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
1667 SELECT CASE (tmpstringlist(1))
1670 t_control%auto_basis_p_lri_aux = isize
1672 cpabort(
"Unknown basis type in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
1675 CALL cp_abort(__location__, &
1676 "AUTO_BASIS keyword in &PROPERTIES &TDDFT section has a wrong number of arguments.")
1680 IF (t_control%conv < 0) &
1681 t_control%conv = abs(t_control%conv)
1689 t_control%dipole_form = 0
1694 CALL section_vals_val_get(dipole_section,
"REFERENCE_POINT", r_vals=t_control%dipole_ref_point)
1696 NULLIFY (t_control%dipole_ref_point)
1698 cpabort(
"User-defined reference point should be given explicitly")
1706 t_control%do_soc = .true.
1713 IF (t_control%mgrid_is_explicit)
THEN
1714 CALL section_vals_val_get(mgrid_section,
"NGRIDS", i_val=t_control%mgrid_ngrids, explicit=explicit)
1715 IF (.NOT. explicit) t_control%mgrid_ngrids =
SIZE(qs_control%e_cutoff)
1717 CALL section_vals_val_get(mgrid_section,
"CUTOFF", r_val=t_control%mgrid_cutoff, explicit=explicit)
1718 IF (.NOT. explicit) t_control%mgrid_cutoff = qs_control%cutoff
1721 r_val=t_control%mgrid_progression_factor, explicit=explicit)
1723 IF (t_control%mgrid_progression_factor <= 1.0_dp) &
1724 CALL cp_abort(__location__, &
1725 "Progression factor should be greater then 1.0 to ensure multi-grid ordering")
1727 t_control%mgrid_progression_factor = qs_control%progression_factor
1730 CALL section_vals_val_get(mgrid_section,
"COMMENSURATE", l_val=t_control%mgrid_commensurate_mgrids, explicit=explicit)
1731 IF (.NOT. explicit) t_control%mgrid_commensurate_mgrids = qs_control%commensurate_mgrids
1732 IF (t_control%mgrid_commensurate_mgrids)
THEN
1734 t_control%mgrid_progression_factor = 4.0_dp
1736 t_control%mgrid_progression_factor = qs_control%progression_factor
1740 CALL section_vals_val_get(mgrid_section,
"REL_CUTOFF", r_val=t_control%mgrid_relative_cutoff, explicit=explicit)
1741 IF (.NOT. explicit) t_control%mgrid_relative_cutoff = qs_control%relative_cutoff
1743 CALL section_vals_val_get(mgrid_section,
"MULTIGRID_SET", l_val=multigrid_set, explicit=explicit)
1744 IF (.NOT. explicit) multigrid_set = .false.
1745 IF (multigrid_set)
THEN
1748 NULLIFY (t_control%mgrid_e_cutoff)
1751 CALL section_vals_val_get(mgrid_section,
"REALSPACE", l_val=t_control%mgrid_realspace_mgrids, explicit=explicit)
1752 IF (.NOT. explicit) t_control%mgrid_realspace_mgrids = qs_control%realspace_mgrids
1755 l_val=t_control%mgrid_skip_load_balance, explicit=explicit)
1756 IF (.NOT. explicit) t_control%mgrid_skip_load_balance = qs_control%skip_load_balance_distributed
1758 IF (
ASSOCIATED(t_control%mgrid_e_cutoff))
THEN
1759 IF (
SIZE(t_control%mgrid_e_cutoff) /= t_control%mgrid_ngrids) &
1760 cpabort(
"Inconsistent values for number of multi-grids")
1763 t_control%mgrid_e_cutoff = -t_control%mgrid_e_cutoff
1764 ALLOCATE (inds(t_control%mgrid_ngrids))
1765 CALL sort(t_control%mgrid_e_cutoff, t_control%mgrid_ngrids, inds)
1767 t_control%mgrid_e_cutoff = -t_control%mgrid_e_cutoff
1781 t_control%stda_control%hfx_fraction = 0.0_dp
1782 t_control%stda_control%do_exchange = .true.
1783 t_control%stda_control%eps_td_filter = 1.e-10_dp
1784 t_control%stda_control%mn_alpha = -99.0_dp
1785 t_control%stda_control%mn_beta = -99.0_dp
1787 SELECT CASE (qs_control%periodicity)
1789 t_control%stda_control%do_ewald = .false.
1791 t_control%stda_control%do_ewald = .true.
1793 t_control%stda_control%do_ewald = .true.
1795 t_control%stda_control%do_ewald = .true.
1797 cpabort(
"Illegal value for periodiciy")
1802 IF (expl) t_control%stda_control%hfx_fraction = hfx
1804 IF (expl) t_control%stda_control%eps_td_filter = filter
1806 IF (expl) t_control%stda_control%do_ewald = do_ewald
1808 IF (expl) t_control%stda_control%do_exchange = do_exchange
1810 t_control%stda_control%mn_alpha = fval
1812 t_control%stda_control%mn_beta = fval
1815 t_control%stda_control%coulomb_sr_cut = fval
1817 t_control%stda_control%coulomb_sr_eps = fval
1820 CALL timestop(handle)
1832 CHARACTER(len=*),
PARAMETER :: routinen =
'write_dft_control'
1834 CHARACTER(LEN=20) :: tmpstr
1835 INTEGER :: handle, i, output_unit
1836 REAL(kind=
dp) :: density_cut, density_smooth_cut_range, &
1837 gradient_cut, tau_cut
1844 IF (dft_control%qs_control%semi_empirical)
RETURN
1845 IF (dft_control%qs_control%dftb)
RETURN
1846 IF (dft_control%qs_control%xtb)
THEN
1847 CALL write_xtb_control(dft_control%qs_control%xtb_control, dft_section)
1850 CALL timeset(routinen, handle)
1856 "PRINT%DFT_CONTROL_PARAMETERS", extension=
".Log")
1858 IF (output_unit > 0)
THEN
1862 IF (dft_control%uks)
THEN
1863 WRITE (unit=output_unit, fmt=
"(/,T2,A,T78,A)") &
1864 "DFT| Spin unrestricted (spin-polarized) Kohn-Sham calculation",
"UKS"
1865 ELSE IF (dft_control%roks)
THEN
1866 WRITE (unit=output_unit, fmt=
"(/,T2,A,T77,A)") &
1867 "DFT| Spin restricted open Kohn-Sham calculation",
"ROKS"
1869 WRITE (unit=output_unit, fmt=
"(/,T2,A,T78,A)") &
1870 "DFT| Spin restricted Kohn-Sham (RKS) calculation",
"RKS"
1873 WRITE (unit=output_unit, fmt=
"(T2,A,T76,I5)") &
1874 "DFT| Multiplicity", dft_control%multiplicity
1875 WRITE (unit=output_unit, fmt=
"(T2,A,T76,I5)") &
1876 "DFT| Number of spin states", dft_control%nspins
1878 WRITE (unit=output_unit, fmt=
"(T2,A,T76,I5)") &
1879 "DFT| Charge", dft_control%charge
1882 SELECT CASE (dft_control%sic_method_id)
1886 tmpstr =
"SPZ/MAURI SIC"
1888 tmpstr =
"US/MAURI SIC"
1892 tmpstr =
"Explicit Orbital SIC"
1895 cpabort(
"SIC option unknown")
1898 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
1899 "DFT| Self-interaction correction (SIC)", adjustr(trim(tmpstr))
1901 IF (dft_control%sic_method_id /=
sic_none)
THEN
1902 WRITE (unit=output_unit, fmt=
"(T2,A,T66,ES15.6)") &
1903 "DFT| SIC scaling parameter a", dft_control%sic_scaling_a, &
1904 "DFT| SIC scaling parameter b", dft_control%sic_scaling_b
1907 IF (dft_control%sic_method_id ==
sic_eo)
THEN
1909 WRITE (unit=output_unit, fmt=
"(T2,A,T66,A)") &
1910 "DFT| SIC orbitals",
"ALL"
1913 WRITE (unit=output_unit, fmt=
"(T2,A,T66,A)") &
1914 "DFT| SIC orbitals",
"UNPAIRED"
1921 CALL section_vals_val_get(xc_section,
"density_smooth_cutoff_range", r_val=density_smooth_cut_range)
1923 WRITE (unit=output_unit, fmt=
"(T2,A,T66,ES15.6)") &
1924 "DFT| Cutoffs: density ", density_cut, &
1925 "DFT| gradient", gradient_cut, &
1926 "DFT| tau ", tau_cut, &
1927 "DFT| cutoff_smoothing_range", density_smooth_cut_range
1930 WRITE (output_unit,
'( A, T61, A )') &
1931 " DFT| XC density smoothing ", adjustr(tmpstr)
1934 WRITE (output_unit,
'( A, T61, A )') &
1935 " DFT| XC derivatives ", adjustr(tmpstr)
1936 IF (dft_control%dft_plus_u)
THEN
1937 NULLIFY (enum, keyword, section)
1941 WRITE (unit=output_unit, fmt=
"(/,T2,A,T41,A40)") &
1942 "DFT+U| Method", adjustr(trim(
enum_i2c(enum, dft_control%plus_u_method_id)))
1943 WRITE (unit=output_unit, fmt=
"(T2,A)") &
1944 "DFT+U| Check atomic kind information for details"
1948 WRITE (unit=output_unit, fmt=
"(A)")
""
1949 CALL xc_write(output_unit, xc_section, dft_control%lsd)
1951 IF (dft_control%apply_period_efield)
THEN
1952 WRITE (unit=output_unit, fmt=
"(A)")
""
1953 IF (dft_control%period_efield%displacement_field)
THEN
1954 WRITE (unit=output_unit, fmt=
"(T2,A)") &
1955 "PERIODIC_EFIELD| Use displacement field formulation"
1956 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,ES14.6)") &
1957 "PERIODIC_EFIELD| Displacement field filter: x", &
1958 dft_control%period_efield%d_filter(1), &
1959 "PERIODIC_EFIELD| y", &
1960 dft_control%period_efield%d_filter(2), &
1961 "PERIODIC_EFIELD| z", &
1962 dft_control%period_efield%d_filter(3)
1964 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,ES14.6)") &
1965 "PERIODIC_EFIELD| Polarisation vector: x", &
1966 dft_control%period_efield%polarisation(1), &
1967 "PERIODIC_EFIELD| y", &
1968 dft_control%period_efield%polarisation(2), &
1969 "PERIODIC_EFIELD| z", &
1970 dft_control%period_efield%polarisation(3)
1972 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,I14)") &
1973 "PERIODIC_EFIELD| Start Frame:", &
1974 dft_control%period_efield%start_frame, &
1975 "PERIODIC_EFIELD| End Frame:", &
1976 dft_control%period_efield%end_frame
1978 IF (
ALLOCATED(dft_control%period_efield%strength_list))
THEN
1979 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,I14)") &
1980 "PERIODIC_EFIELD| Number of Intensities:", &
1981 SIZE(dft_control%period_efield%strength_list)
1982 WRITE (unit=output_unit, fmt=
"(T2,A,I10,T66,1X,ES14.6)") &
1983 "PERIODIC_EFIELD| Intensity List [a.u.] ", &
1984 1, dft_control%period_efield%strength_list(1)
1985 DO i = 2,
SIZE(dft_control%period_efield%strength_list)
1986 WRITE (unit=output_unit, fmt=
"(T2,A,I10,T66,1X,ES14.6)") &
1987 "PERIODIC_EFIELD| ", &
1988 i, dft_control%period_efield%strength_list(i)
1991 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,ES14.6)") &
1992 "PERIODIC_EFIELD| Intensity [a.u.]:", &
1993 dft_control%period_efield%strength
1996 IF (sqrt(dot_product(dft_control%period_efield%polarisation, &
1997 dft_control%period_efield%polarisation)) < epsilon(0.0_dp))
THEN
1998 cpabort(
"Invalid (too small) polarisation vector specified for PERIODIC_EFIELD")
2002 IF (dft_control%do_sccs)
THEN
2003 WRITE (unit=output_unit, fmt=
"(/,T2,A)") &
2004 "SCCS| Self-consistent continuum solvation model"
2005 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2006 "SCCS| Relative permittivity of the solvent (medium)", &
2007 dft_control%sccs_control%epsilon_solvent, &
2008 "SCCS| Absolute permittivity [a.u.]", &
2009 dft_control%sccs_control%epsilon_solvent/
fourpi
2010 SELECT CASE (dft_control%sccs_control%method_id)
2012 WRITE (unit=output_unit, fmt=
"(T2,A,/,(T2,A,T61,ES20.6))") &
2013 "SCCS| Dielectric function proposed by Andreussi et al.", &
2014 "SCCS| rho_max", dft_control%sccs_control%rho_max, &
2015 "SCCS| rho_min", dft_control%sccs_control%rho_min
2017 WRITE (unit=output_unit, fmt=
"(T2,A,/,(T2,A,T61,ES20.6))") &
2018 "SCCS| Dielectric function proposed by Fattebert and Gygi", &
2019 "SCCS| beta", dft_control%sccs_control%beta, &
2020 "SCCS| rho_zero", dft_control%sccs_control%rho_zero
2022 cpabort(
"Invalid SCCS model specified. Please, check your input!")
2024 SELECT CASE (dft_control%sccs_control%derivative_method)
2026 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2027 "SCCS| Numerical derivative calculation", &
2030 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2031 "SCCS| Numerical derivative calculation", &
2032 adjustr(
"3-point stencil central differences")
2034 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2035 "SCCS| Numerical derivative calculation", &
2036 adjustr(
"5-point stencil central differences")
2038 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2039 "SCCS| Numerical derivative calculation", &
2040 adjustr(
"7-point stencil central differences")
2042 CALL cp_abort(__location__, &
2043 "Invalid derivative method specified for SCCS model. "// &
2044 "Please, check your input!")
2046 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2047 "SCCS| Repulsion parameter alpha [mN/m] = [dyn/cm]", &
2049 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2050 "SCCS| Dispersion parameter beta [GPa]", &
2052 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2053 "SCCS| Surface tension gamma [mN/m] = [dyn/cm]", &
2055 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2056 "SCCS| Mixing parameter applied during the iteration cycle", &
2057 dft_control%sccs_control%mixing
2058 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2059 "SCCS| Tolerance for the convergence of the SCCS iteration cycle", &
2060 dft_control%sccs_control%eps_sccs
2061 WRITE (unit=output_unit, fmt=
"(T2,A,T61,I20)") &
2062 "SCCS| Maximum number of iteration steps", &
2063 dft_control%sccs_control%max_iter
2064 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2065 "SCCS| SCF convergence threshold for starting the SCCS iteration", &
2066 dft_control%sccs_control%eps_scf
2067 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2068 "SCCS| Numerical increment for the cavity surface calculation", &
2069 dft_control%sccs_control%delta_rho
2072 WRITE (unit=output_unit, fmt=
"(A)")
""
2077 "PRINT%DFT_CONTROL_PARAMETERS")
2079 CALL timestop(handle)
2099 "PRINT%DFT_CONTROL_PARAMETERS", extension=
".Log")
2101 IF (iounit > 0)
THEN
2103 SELECT CASE (admm_control%admm_type)
2105 WRITE (unit=iounit, fmt=
"(/,T2,A,T77,A)")
"ADMM| Specific ADMM type specified",
"NONE"
2107 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMM1"
2109 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMM2"
2111 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMMS"
2113 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMMP"
2115 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMMQ"
2117 cpabort(
"admm_type")
2120 SELECT CASE (admm_control%purification_method)
2122 WRITE (unit=iounit, fmt=
"(T2,A,T77,A)")
"ADMM| Density matrix purification method",
"NONE"
2124 WRITE (unit=iounit, fmt=
"(T2,A,T75,A)")
"ADMM| Density matrix purification method",
"Cauchy"
2126 WRITE (unit=iounit, fmt=
"(T2,A,T66,A)")
"ADMM| Density matrix purification method",
"Cauchy subspace"
2128 WRITE (unit=iounit, fmt=
"(T2,A,T63,A)")
"ADMM| Density matrix purification method",
"MO diagonalization"
2130 WRITE (unit=iounit, fmt=
"(T2,A,T71,A)")
"ADMM| Density matrix purification method",
"MO no diag"
2132 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Density matrix purification method",
"McWeeny"
2134 WRITE (unit=iounit, fmt=
"(T2,A,T73,A)")
"ADMM| Density matrix purification method",
"NONE(DM)"
2136 cpabort(
"admm_purification_method")
2139 SELECT CASE (admm_control%method)
2141 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Orbital projection on ADMM basis"
2143 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Blocked Fock matrix projection with full purification"
2145 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Blocked Fock matrix projection"
2147 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Orbital projection with charge constrain"
2149 cpabort(
"admm method")
2152 SELECT CASE (admm_control%scaling_model)
2155 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Use Merlot (2014) scaling model"
2157 cpabort(
"admm scaling_model")
2160 WRITE (unit=iounit, fmt=
"(T2,A,T61,G20.10)")
"ADMM| eps_filter", admm_control%eps_filter
2162 SELECT CASE (admm_control%aux_exch_func)
2164 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| No exchange functional correction term used"
2166 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Exchange functional in correction term",
"(W)PBEX"
2168 WRITE (unit=iounit, fmt=
"(T2,A,T77,A)")
"ADMM| Exchange functional in correction term",
"PBEX"
2170 WRITE (unit=iounit, fmt=
"(T2,A,T77,A)")
"ADMM| Exchange functional in correction term",
"OPTX"
2172 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Exchange functional in correction term",
"Becke88"
2174 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Exchange functional in correction term",
"SlaterX"
2176 cpabort(
"admm aux_exch_func")
2179 WRITE (unit=iounit, fmt=
"(A)")
""
2184 "PRINT%DFT_CONTROL_PARAMETERS")
2192 SUBROUTINE write_xtb_control(xtb_control, dft_section)
2196 CHARACTER(len=*),
PARAMETER :: routinen =
'write_xtb_control'
2198 INTEGER :: handle, output_unit
2201 CALL timeset(routinen, handle)
2206 "PRINT%DFT_CONTROL_PARAMETERS", extension=
".Log")
2208 IF (output_unit > 0)
THEN
2210 WRITE (unit=output_unit, fmt=
"(/,T2,A,T31,A50)") &
2211 "xTB| Parameter file", adjustr(trim(xtb_control%parameter_file_name))
2212 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2213 "xTB| Basis expansion STO-NG", xtb_control%sto_ng
2214 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2215 "xTB| Basis expansion STO-NG for Hydrogen", xtb_control%h_sto_ng
2216 WRITE (unit=output_unit, fmt=
"(T2,A,T71,E10.4)") &
2217 "xTB| Repulsive pair potential accuracy", xtb_control%eps_pair
2218 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.6)") &
2219 "xTB| Repulsive enhancement factor", xtb_control%enscale
2220 WRITE (unit=output_unit, fmt=
"(T2,A,T71,L10)") &
2221 "xTB| Halogen interaction potential", xtb_control%xb_interaction
2222 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2223 "xTB| Halogen interaction potential cutoff radius", xtb_control%xb_radius
2224 WRITE (unit=output_unit, fmt=
"(T2,A,T71,L10)") &
2225 "xTB| Nonbonded interactions", xtb_control%do_nonbonded
2226 SELECT CASE (xtb_control%vdw_type)
2228 WRITE (unit=output_unit, fmt=
"(T2,A)")
"xTB| No vdW potential selected"
2230 WRITE (unit=output_unit, fmt=
"(T2,A,T72,A)")
"xTB| vdW potential type:",
"DFTD3(BJ)"
2231 WRITE (unit=output_unit, fmt=
"(T2,A,T31,A50)") &
2232 "xTB| D3 Dispersion: Parameter file", adjustr(trim(xtb_control%dispersion_parameter_file))
2234 WRITE (unit=output_unit, fmt=
"(T2,A,T76,A)")
"xTB| vdW potential type:",
"DFTD4"
2235 WRITE (unit=output_unit, fmt=
"(T2,A,T31,A50)") &
2236 "xTB| D4 Dispersion: Parameter file", adjustr(trim(xtb_control%dispersion_parameter_file))
2240 WRITE (unit=output_unit, fmt=
"(T2,A,T51,3F10.3)") &
2241 "xTB| Huckel constants ks kp kd", xtb_control%ks, xtb_control%kp, xtb_control%kd
2242 WRITE (unit=output_unit, fmt=
"(T2,A,T61,2F10.3)") &
2243 "xTB| Huckel constants ksp k2sh", xtb_control%ksp, xtb_control%k2sh
2244 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2245 "xTB| Mataga-Nishimoto exponent", xtb_control%kg
2246 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2247 "xTB| Repulsion potential exponent", xtb_control%kf
2248 WRITE (unit=output_unit, fmt=
"(T2,A,T51,3F10.3)") &
2249 "xTB| Coordination number scaling kcn(s) kcn(p) kcn(d)", &
2250 xtb_control%kcns, xtb_control%kcnp, xtb_control%kcnd
2251 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2252 "xTB| Electronegativity scaling", xtb_control%ken
2253 WRITE (unit=output_unit, fmt=
"(T2,A,T61,2F10.3)") &
2254 "xTB| Halogen potential scaling kxr kx2", xtb_control%kxr, xtb_control%kx2
2255 WRITE (unit=output_unit, fmt=
"(/)")
2260 "PRINT%DFT_CONTROL_PARAMETERS")
2262 CALL timestop(handle)
2264 END SUBROUTINE write_xtb_control
2275 CHARACTER(len=*),
PARAMETER :: routinen =
'write_qs_control'
2277 CHARACTER(len=20) :: method, quadrature
2278 INTEGER :: handle, i, igrid_level, ngrid_level, &
2287 IF (qs_control%semi_empirical)
RETURN
2288 IF (qs_control%dftb)
RETURN
2289 IF (qs_control%xtb)
RETURN
2290 CALL timeset(routinen, handle)
2291 NULLIFY (logger, print_section_vals, qs_section, qs_section_vals)
2297 NULLIFY (enum, keyword)
2300 method =
enum_i2c(enum, qs_control%method_id)
2302 NULLIFY (enum, keyword)
2305 quadrature =
enum_i2c(enum, qs_control%gapw_control%quadrature)
2308 "DFT_CONTROL_PARAMETERS", extension=
".Log")
2309 IF (output_unit > 0)
THEN
2310 ngrid_level =
SIZE(qs_control%e_cutoff)
2311 WRITE (unit=output_unit, fmt=
"(/,T2,A,T61,A20)") &
2312 "QS| Method:", adjustr(method)
2313 IF (qs_control%pw_grid_opt%spherical)
THEN
2314 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A)") &
2315 "QS| Density plane wave grid type",
" SPHERICAL HALFSPACE"
2316 ELSE IF (qs_control%pw_grid_opt%fullspace)
THEN
2317 WRITE (unit=output_unit, fmt=
"(T2,A,T57,A)") &
2318 "QS| Density plane wave grid type",
" NON-SPHERICAL FULLSPACE"
2320 WRITE (unit=output_unit, fmt=
"(T2,A,T57,A)") &
2321 "QS| Density plane wave grid type",
" NON-SPHERICAL HALFSPACE"
2323 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2324 "QS| Number of grid levels:",
SIZE(qs_control%e_cutoff)
2325 IF (ngrid_level == 1)
THEN
2326 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2327 "QS| Density cutoff [a.u.]:", qs_control%e_cutoff(1)
2329 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2330 "QS| Density cutoff [a.u.]:", qs_control%cutoff
2331 IF (qs_control%commensurate_mgrids) &
2332 WRITE (unit=output_unit, fmt=
"(T2,A)")
"QS| Using commensurate multigrids"
2333 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2334 "QS| Multi grid cutoff [a.u.]: 1) grid level", qs_control%e_cutoff(1)
2335 WRITE (unit=output_unit, fmt=
"(T2,A,I3,A,T71,F10.1)") &
2336 (
"QS| ", igrid_level,
") grid level", &
2337 qs_control%e_cutoff(igrid_level), &
2338 igrid_level=2,
SIZE(qs_control%e_cutoff))
2340 IF (qs_control%pao)
THEN
2341 WRITE (unit=output_unit, fmt=
"(T2,A)")
"QS| PAO active"
2343 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2344 "QS| Grid level progression factor:", qs_control%progression_factor
2345 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2346 "QS| Relative density cutoff [a.u.]:", qs_control%relative_cutoff
2347 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2348 "QS| Interaction thresholds: eps_pgf_orb:", &
2349 qs_control%eps_pgf_orb, &
2350 "QS| eps_filter_matrix:", &
2351 qs_control%eps_filter_matrix, &
2352 "QS| eps_core_charge:", &
2353 qs_control%eps_core_charge, &
2354 "QS| eps_rho_gspace:", &
2355 qs_control%eps_rho_gspace, &
2356 "QS| eps_rho_rspace:", &
2357 qs_control%eps_rho_rspace, &
2358 "QS| eps_gvg_rspace:", &
2359 qs_control%eps_gvg_rspace, &
2361 qs_control%eps_ppl, &
2364 IF (qs_control%gapw)
THEN
2365 SELECT CASE (qs_control%gapw_control%basis_1c)
2367 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2368 "QS| GAPW| One center basis from orbital basis primitives"
2370 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2371 "QS| GAPW| One center basis extended with primitives (small:s)"
2373 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2374 "QS| GAPW| One center basis extended with primitives (medium:sp)"
2376 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2377 "QS| GAPW| One center basis extended with primitives (large:spd)"
2379 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2380 "QS| GAPW| One center basis extended with primitives (very large:spdf)"
2382 cpabort(
"basis_1c incorrect")
2384 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2385 "QS| GAPW| eps_fit:", &
2386 qs_control%gapw_control%eps_fit, &
2387 "QS| GAPW| eps_iso:", &
2388 qs_control%gapw_control%eps_iso, &
2389 "QS| GAPW| eps_svd:", &
2390 qs_control%gapw_control%eps_svd, &
2391 "QS| GAPW| eps_cpc:", &
2392 qs_control%gapw_control%eps_cpc
2393 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2394 "QS| GAPW| atom-r-grid: quadrature:", &
2396 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2397 "QS| GAPW| atom-s-grid: max l :", &
2398 qs_control%gapw_control%lmax_sphere, &
2399 "QS| GAPW| max_l_rho0 :", &
2400 qs_control%gapw_control%lmax_rho0
2401 IF (qs_control%gapw_control%non_paw_atoms)
THEN
2402 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2403 "QS| GAPW| At least one kind is NOT PAW, i.e. it has only soft AO "
2405 IF (qs_control%gapw_control%nopaw_as_gpw)
THEN
2406 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2407 "QS| GAPW| The NOT PAW atoms are treated fully GPW"
2410 IF (qs_control%gapw_xc)
THEN
2411 SELECT CASE (qs_control%gapw_control%basis_1c)
2413 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2414 "QS| GAPW_XC| One center basis from orbital basis primitives"
2416 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2417 "QS| GAPW_XC| One center basis extended with primitives (small:s)"
2419 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2420 "QS| GAPW_XC| One center basis extended with primitives (medium:sp)"
2422 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2423 "QS| GAPW_XC| One center basis extended with primitives (large:spd)"
2425 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2426 "QS| GAPW_XC| One center basis extended with primitives (very large:spdf)"
2428 cpabort(
"basis_1c incorrect")
2430 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2431 "QS| GAPW_XC| eps_fit:", &
2432 qs_control%gapw_control%eps_fit, &
2433 "QS| GAPW_XC| eps_iso:", &
2434 qs_control%gapw_control%eps_iso, &
2435 "QS| GAPW_XC| eps_svd:", &
2436 qs_control%gapw_control%eps_svd
2437 WRITE (unit=output_unit, fmt=
"(T2,A,T55,A30)") &
2438 "QS| GAPW_XC|atom-r-grid: quadrature:", &
2439 enum_i2c(enum, qs_control%gapw_control%quadrature)
2440 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2441 "QS| GAPW_XC| atom-s-grid: max l :", &
2442 qs_control%gapw_control%lmax_sphere
2444 IF (qs_control%mulliken_restraint)
THEN
2445 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2446 "QS| Mulliken restraint target", qs_control%mulliken_restraint_control%target
2447 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2448 "QS| Mulliken restraint strength", qs_control%mulliken_restraint_control%strength
2449 WRITE (unit=output_unit, fmt=
"(T2,A,T73,I8)") &
2450 "QS| Mulliken restraint atoms: ", qs_control%mulliken_restraint_control%natoms
2451 WRITE (unit=output_unit, fmt=
"(5I8)") qs_control%mulliken_restraint_control%atoms
2453 IF (qs_control%ddapc_restraint)
THEN
2454 DO i = 1,
SIZE(qs_control%ddapc_restraint_control)
2455 ddapc_restraint_control => qs_control%ddapc_restraint_control(i)
2456 IF (
SIZE(qs_control%ddapc_restraint_control) .GT. 1) &
2457 WRITE (unit=output_unit, fmt=
"(T2,A,T3,I8)") &
2458 "QS| parameters for DDAPC restraint number", i
2459 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2460 "QS| ddapc restraint target", ddapc_restraint_control%target
2461 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2462 "QS| ddapc restraint strength", ddapc_restraint_control%strength
2463 WRITE (unit=output_unit, fmt=
"(T2,A,T73,I8)") &
2464 "QS| ddapc restraint atoms: ", ddapc_restraint_control%natoms
2465 WRITE (unit=output_unit, fmt=
"(5I8)") ddapc_restraint_control%atoms
2466 WRITE (unit=output_unit, fmt=
"(T2,A)")
"Coefficients:"
2467 WRITE (unit=output_unit, fmt=
"(5F6.2)") ddapc_restraint_control%coeff
2468 SELECT CASE (ddapc_restraint_control%functional_form)
2470 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2471 "QS| ddapc restraint functional form :",
"RESTRAINT"
2473 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2474 "QS| ddapc restraint functional form :",
"CONSTRAINT"
2476 cpabort(
"Unknown ddapc restraint")
2480 IF (qs_control%s2_restraint)
THEN
2481 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2482 "QS| s2 restraint target", qs_control%s2_restraint_control%target
2483 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2484 "QS| s2 restraint strength", qs_control%s2_restraint_control%strength
2485 SELECT CASE (qs_control%s2_restraint_control%functional_form)
2487 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2488 "QS| s2 restraint functional form :",
"RESTRAINT"
2489 cpabort(
"Not yet implemented")
2491 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2492 "QS| s2 restraint functional form :",
"CONSTRAINT"
2494 cpabort(
"Unknown ddapc restraint")
2499 "DFT_CONTROL_PARAMETERS")
2501 CALL timestop(handle)
2519 TYPE(
section_vals_type),
OPTIONAL,
POINTER :: qs_section, ddapc_restraint_section
2521 INTEGER :: i, j, jj, k, n_rep
2522 INTEGER,
DIMENSION(:),
POINTER :: tmplist
2523 REAL(kind=
dp),
DIMENSION(:),
POINTER :: rtmplist
2527 IF (
PRESENT(ddapc_restraint_section))
THEN
2528 IF (
ASSOCIATED(qs_control%ddapc_restraint_control))
THEN
2529 IF (
SIZE(qs_control%ddapc_restraint_control) .GE. 2) &
2530 cpabort(
"ET_COUPLING cannot be used in combination with a normal restraint")
2532 ddapc_section => ddapc_restraint_section
2533 ALLOCATE (qs_control%ddapc_restraint_control(1))
2537 IF (
PRESENT(qs_section))
THEN
2538 NULLIFY (ddapc_section)
2543 DO i = 1,
SIZE(qs_control%ddapc_restraint_control)
2546 ddapc_restraint_control => qs_control%ddapc_restraint_control(i)
2549 r_val=ddapc_restraint_control%strength)
2551 r_val=ddapc_restraint_control%target)
2553 i_val=ddapc_restraint_control%functional_form)
2557 i_val=ddapc_restraint_control%density_type)
2562 i_rep_val=k, i_vals=tmplist)
2563 DO j = 1,
SIZE(tmplist)
2567 IF (jj < 1) cpabort(
"Need at least 1 atom to use ddapc constraints")
2568 ddapc_restraint_control%natoms = jj
2569 IF (
ASSOCIATED(ddapc_restraint_control%atoms)) &
2570 DEALLOCATE (ddapc_restraint_control%atoms)
2571 ALLOCATE (ddapc_restraint_control%atoms(ddapc_restraint_control%natoms))
2575 i_rep_val=k, i_vals=tmplist)
2576 DO j = 1,
SIZE(tmplist)
2578 ddapc_restraint_control%atoms(jj) = tmplist(j)
2582 IF (
ASSOCIATED(ddapc_restraint_control%coeff)) &
2583 DEALLOCATE (ddapc_restraint_control%coeff)
2584 ALLOCATE (ddapc_restraint_control%coeff(ddapc_restraint_control%natoms))
2585 ddapc_restraint_control%coeff = 1.0_dp
2592 i_rep_val=k, r_vals=rtmplist)
2593 DO j = 1,
SIZE(rtmplist)
2595 IF (jj > ddapc_restraint_control%natoms) &
2596 cpabort(
"Need the same number of coeff as there are atoms ")
2597 ddapc_restraint_control%coeff(jj) = rtmplist(j)
2600 IF (jj < ddapc_restraint_control%natoms .AND. jj .NE. 0) &
2601 cpabort(
"Need no or the same number of coeff as there are atoms.")
2604 DO i = 1,
SIZE(qs_control%ddapc_restraint_control)
2605 IF (qs_control%ddapc_restraint_control(i)%functional_form == &
2608 IF (k == 2)
CALL cp_abort(__location__, &
2609 "Only a single constraint possible yet, try to use restraints instead ")
2618 SUBROUTINE read_efield_sections(dft_control, efield_section)
2622 CHARACTER(len=default_path_length) :: file_name
2623 INTEGER :: i, io, j, n, unit_nr
2624 REAL(kind=
dp),
DIMENSION(:),
POINTER :: tmp_vals
2628 DO i = 1,
SIZE(dft_control%efield_fields)
2629 NULLIFY (dft_control%efield_fields(i)%efield)
2630 ALLOCATE (dft_control%efield_fields(i)%efield)
2631 efield => dft_control%efield_fields(i)%efield
2632 NULLIFY (efield%envelop_i_vars, efield%envelop_r_vars)
2634 r_val=efield%strength)
2638 ALLOCATE (efield%polarisation(
SIZE(tmp_vals)))
2639 efield%polarisation = tmp_vals
2641 r_val=efield%phase_offset)
2643 i_val=efield%envelop_id)
2645 r_val=efield%wavelength)
2648 efield%vec_pot_initial = tmp_vals
2651 ALLOCATE (efield%envelop_i_vars(2))
2654 i_val=efield%envelop_i_vars(1))
2656 i_val=efield%envelop_i_vars(2))
2658 ALLOCATE (efield%envelop_r_vars(2))
2661 r_val=efield%envelop_r_vars(1))
2663 r_val=efield%envelop_r_vars(2))
2664 ELSE IF (efield%envelop_id ==
ramp_env)
THEN
2665 ALLOCATE (efield%envelop_i_vars(4))
2668 i_val=efield%envelop_i_vars(1))
2670 i_val=efield%envelop_i_vars(2))
2672 i_val=efield%envelop_i_vars(3))
2674 i_val=efield%envelop_i_vars(4))
2675 ELSE IF (efield%envelop_id ==
custom_env)
THEN
2678 CALL open_file(file_name=trim(file_name), file_action=
"READ", file_status=
"OLD", unit_number=unit_nr)
2682 READ (unit_nr, *, iostat=io)
2687 ALLOCATE (efield%envelop_r_vars(n + 1))
2692 READ (unit_nr, *) efield%envelop_r_vars(j)
2693 efield%envelop_r_vars(j) =
cp_unit_to_cp2k(efield%envelop_r_vars(j),
"volt/m")
2698 END SUBROUTINE read_efield_sections
2706 SUBROUTINE read_rtp_section(dft_control, rtp_section)
2711 INTEGER,
DIMENSION(:),
POINTER :: tmp
2712 LOGICAL :: is_present
2715 ALLOCATE (dft_control%rtp_control)
2717 i_val=dft_control%rtp_control%max_iter)
2719 i_val=dft_control%rtp_control%mat_exp)
2721 i_val=dft_control%rtp_control%aspc_order)
2723 r_val=dft_control%rtp_control%eps_exp)
2725 i_val=dft_control%rtp_control%rtp_method)
2727 i_val=dft_control%rtp_control%rtbse_ham)
2729 i_val=dft_control%rtp_control%propagator)
2731 r_val=dft_control%rtp_control%eps_ener)
2733 i_val=dft_control%rtp_control%initial_wfn)
2735 l_val=dft_control%rtp_control%hfx_redistribute)
2737 l_val=dft_control%rtp_control%apply_wfn_mix_init_restart)
2739 l_val=dft_control%rtp_control%apply_delta_pulse)
2741 l_val=dft_control%rtp_control%apply_delta_pulse_mag)
2743 l_val=dft_control%rtp_control%velocity_gauge)
2745 l_val=dft_control%rtp_control%nl_gauge_transform)
2747 l_val=dft_control%rtp_control%periodic)
2749 l_val=dft_control%rtp_control%linear_scaling)
2751 i_val=dft_control%rtp_control%mcweeny_max_iter)
2753 i_val=dft_control%rtp_control%acc_ref)
2755 r_val=dft_control%rtp_control%mcweeny_eps)
2757 r_val=dft_control%rtp_control%delta_pulse_scale)
2760 dft_control%rtp_control%delta_pulse_direction = tmp
2762 i_val=dft_control%rtp_control%sc_check_start)
2765 IF (is_present)
THEN
2766 IF (dft_control%rtp_control%linear_scaling) &
2767 CALL cp_abort(__location__, &
2768 "You have defined a time dependent projection of mos, but "// &
2769 "only the density matrix is propagated (DENSITY_PROPAGATION "// &
2770 ".TRUE.). Please either use MO-based real time DFT or do not "// &
2771 "define any PRINT%PROJECTION_MO section")
2772 dft_control%rtp_control%is_proj_mo = .true.
2774 dft_control%rtp_control%is_proj_mo = .false.
2777 END SUBROUTINE read_rtp_section
2784 SUBROUTINE read_admm_block_list(admm_control, dft_section)
2788 INTEGER :: irep, list_size, n_rep
2789 INTEGER,
DIMENSION(:),
POINTER :: tmplist
2796 ALLOCATE (admm_control%blocks(n_rep))
2800 i_rep_val=irep, i_vals=tmplist)
2801 list_size =
SIZE(tmplist)
2802 ALLOCATE (admm_control%blocks(irep)%list(list_size))
2803 admm_control%blocks(irep)%list(:) = tmplist(:)
2806 END SUBROUTINE read_admm_block_list
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 stengel2009
integer, save, public vandevondele2005a
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 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
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_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)
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.
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...