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
125 TYPE(
section_vals_type),
POINTER :: hairy_probes_section, hfx_section, maxwell_section, &
126 sccs_section, scf_section, tmp_section, xc_fun_section, xc_section
128 was_present = .false.
132 NULLIFY (tmp_section, xc_fun_section, xc_section)
133 ALLOCATE (dft_control)
139 SELECT CASE (method_id)
147 IF (.NOT. is_present .AND. not_se)
THEN
148 cpabort(
"XC section missing.")
155 IF (density_cut <= epsilon(0.0_dp)*100.0_dp) &
156 CALL cp_warn(__location__, &
157 "DENSITY_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
158 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
159 density_cut = max(epsilon(0.0_dp)*100.0_dp, density_cut)
160 IF (gradient_cut <= epsilon(0.0_dp)*100.0_dp) &
161 CALL cp_warn(__location__, &
162 "GRADIENT_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
163 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
164 gradient_cut = max(epsilon(0.0_dp)*100.0_dp, gradient_cut)
165 IF (tau_cut <= epsilon(0.0_dp)*100.0_dp) &
166 CALL cp_warn(__location__, &
167 "TAU_CUTOFF lower than 100*EPSILON, where EPSILON is the machine precision. "// &
168 "This may lead to numerical problems. Setting up shake_tol to 100*EPSILON! ")
169 tau_cut = max(epsilon(0.0_dp)*100.0_dp, tau_cut)
176 IF (.NOT. is_present .AND. not_se)
THEN
177 cpabort(
"XC_FUNCTIONAL section missing.")
182 IF (dft_control%uks .OR. dft_control%roks)
THEN
183 dft_control%nspins = 2
185 dft_control%nspins = 1
188 dft_control%lsd = (dft_control%nspins > 1)
192 dft_control%drho_by_collocation = (
xc_uses_norm_drho(xc_fun_section, dft_control%lsd) &
194 IF (dft_control%drho_by_collocation)
THEN
195 cpabort(
"derivatives by collocation not implemented")
202 IF (
SIZE(tmpstringlist) == 2)
THEN
204 SELECT CASE (tmpstringlist(2))
216 cpwarn(
"Unknown basis size in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
219 SELECT CASE (tmpstringlist(1))
222 dft_control%auto_basis_ri_aux = isize
224 dft_control%auto_basis_aux_fit = isize
226 dft_control%auto_basis_lri_aux = isize
228 dft_control%auto_basis_p_lri_aux = isize
230 dft_control%auto_basis_ri_hxc = isize
232 dft_control%auto_basis_ri_xas = isize
234 dft_control%auto_basis_ri_hfx = isize
236 cpwarn(
"Unknown basis type in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
239 CALL cp_abort(__location__, &
240 "AUTO_BASIS keyword in &DFT section has a wrong number of arguments.")
251 is_present = is_present .AND. (do_hfx .OR. do_rpa_admm)
253 dft_control%do_admm = is_present
254 dft_control%do_admm_mo = .false.
255 dft_control%do_admm_dm = .false.
261 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_TYPE", i_val=admmtype)
262 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", explicit=exopt1)
263 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%METHOD", explicit=exopt2)
264 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_SCALING_MODEL", explicit=exopt3)
265 dft_control%admm_control%admm_type = admmtype
266 SELECT CASE (admmtype)
268 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", i_val=method_id)
269 dft_control%admm_control%purification_method = method_id
270 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%METHOD", i_val=method_id)
271 dft_control%admm_control%method = method_id
272 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_SCALING_MODEL", i_val=method_id)
273 dft_control%admm_control%scaling_model = method_id
278 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%ADMM_PURIFICATION_METHOD", i_val=method_id)
279 dft_control%admm_control%purification_method = method_id
311 CALL cp_abort(__location__, &
312 "ADMM_TYPE keyword in &AUXILIARY_DENSITY_MATRIX_METHOD section has a wrong value.")
316 r_val=dft_control%admm_control%eps_filter)
318 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%EXCH_CORRECTION_FUNC", i_val=method_id)
319 dft_control%admm_control%aux_exch_func = method_id
322 dft_control%admm_control%aux_exch_func_param = .false.
323 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_A1", explicit=explicit, &
324 r_val=dft_control%admm_control%aux_x_param(1))
325 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
326 CALL section_vals_val_get(dft_section,
"AUXILIARY_DENSITY_MATRIX_METHOD%OPTX_A2", explicit=explicit, &
327 r_val=dft_control%admm_control%aux_x_param(2))
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_GAMMA", explicit=explicit, &
330 r_val=dft_control%admm_control%aux_x_param(3))
331 IF (explicit) dft_control%admm_control%aux_exch_func_param = .true.
333 CALL read_admm_block_list(dft_control%admm_control, dft_section)
336 SELECT CASE (admmtype)
338 IF (exopt2)
CALL cp_warn(__location__, &
339 "Value of ADMM_PURIFICATION_METHOD keyword will be overwritten with ADMM_TYPE selections.")
340 IF (exopt3)
CALL cp_warn(__location__, &
341 "Value of EXCH_SCALING_MODEL keyword will be overwritten with ADMM_TYPE selections.")
343 IF (exopt1)
CALL cp_warn(__location__, &
344 "Value of METHOD keyword will be overwritten with ADMM_TYPE selections.")
345 IF (exopt2)
CALL cp_warn(__location__, &
346 "Value of METHOD keyword will be overwritten with ADMM_TYPE selections.")
347 IF (exopt3)
CALL cp_warn(__location__, &
348 "Value of EXCH_SCALING_MODEL keyword will be overwritten with ADMM_TYPE selections.")
357 cpabort(
"ADMM: Blocking and Merlot scaling are mutually exclusive.")
362 CALL cp_abort(__location__, &
363 "ADMM: In the case of METHOD=CHARGE_CONSTRAINED_PROJECTION, "// &
364 "ADMM_PURIFICATION_METHOD=NONE has to be set.")
370 cpabort(
"ADMM: Chosen purification requires BASIS_PROJECTION")
372 IF (.NOT. do_ot) cpabort(
"ADMM: MO-based purification requires OT.")
377 dft_control%do_admm_dm = .true.
379 dft_control%do_admm_mo = .true.
387 dft_control%restricted = (dft_control%roks .AND. l_param)
391 CALL section_vals_val_get(dft_section,
"RELAX_MULTIPLICITY", r_val=dft_control%relax_multiplicity)
392 IF (dft_control%relax_multiplicity > 0.0_dp)
THEN
393 IF (.NOT. dft_control%uks) &
394 CALL cp_abort(__location__,
"The option RELAX_MULTIPLICITY is only valid for "// &
395 "unrestricted Kohn-Sham (UKS) calculations")
400 CALL section_vals_get(hairy_probes_section, n_repetition=nrep, explicit=is_present)
403 dft_control%hairy_probes = .true.
404 ALLOCATE (dft_control%probe(nrep))
405 CALL read_hairy_probes_sections(dft_control, hairy_probes_section)
412 dft_control%sic_method_id =
sic_none
413 dft_control%sic_scaling_a = 1.0_dp
414 dft_control%sic_scaling_b = 1.0_dp
417 dft_control%dft_plus_u = .false.
419 dft_control%plus_u_method_id = method_id
422 dft_control%smear = .false.
425 dft_control%correct_surf_dip = .false.
426 CALL section_vals_val_get(dft_section,
"SURFACE_DIPOLE_CORRECTION", l_val=dft_control%correct_surf_dip)
428 dft_control%pos_dir_surf_dip = -1.0_dp
432 dft_control%switch_surf_dip = .false.
433 dft_control%surf_dip_correct_switch = dft_control%correct_surf_dip
435 dft_control%correct_el_density_dip = .false.
436 CALL section_vals_val_get(dft_section,
"CORE_CORR_DIP", l_val=dft_control%correct_el_density_dip)
437 IF (dft_control%correct_el_density_dip)
THEN
438 IF (dft_control%correct_surf_dip)
THEN
441 dft_control%correct_el_density_dip = .false.
442 cpwarn(
"CORE_CORR_DIP keyword is activated only if SURFACE_DIPOLE_CORRECTION is TRUE")
447 c_val=basis_set_file_name)
449 c_val=potential_file_name)
454 i_val=dft_control%sic_method_id)
456 i_val=dft_control%sic_list_id)
458 r_val=dft_control%sic_scaling_a)
460 r_val=dft_control%sic_scaling_b)
466 CALL read_rtp_section(dft_control, tmp_section)
473 IF (dft_control%do_xas_calculation)
THEN
476 l_val=dft_control%do_xas_calculation)
480 CALL section_vals_get(tmp_section, explicit=dft_control%do_xas_tdp_calculation)
481 IF (dft_control%do_xas_tdp_calculation)
THEN
484 l_val=dft_control%do_xas_tdp_calculation)
488 dft_control%apply_efield = .false.
489 dft_control%apply_efield_field = .false.
490 dft_control%apply_vector_potential = .false.
494 ALLOCATE (dft_control%efield_fields(nrep))
495 CALL read_efield_sections(dft_control, tmp_section)
497 IF (.NOT. dft_control%rtp_control%velocity_gauge)
THEN
498 dft_control%apply_efield_field = .true.
500 dft_control%apply_vector_potential = .true.
502 dft_control%rtp_control%vec_pot = dft_control%efield_fields(1)%efield%vec_pot_initial
505 dft_control%apply_efield = .true.
512 CALL section_vals_get(tmp_section, explicit=dft_control%apply_period_efield)
513 IF (dft_control%apply_period_efield)
THEN
514 ALLOCATE (dft_control%period_efield)
516 dft_control%period_efield%polarisation(1:3) = pol(1:3)
518 dft_control%period_efield%d_filter(1:3) = pol(1:3)
520 r_val=dft_control%period_efield%strength)
521 dft_control%period_efield%displacement_field = .false.
523 l_val=dft_control%period_efield%displacement_field)
529 IF (
SIZE(pol) > 1 .OR. pol(1) /= 0.0_dp)
THEN
531 IF (dft_control%period_efield%strength /= 0.0_dp .OR. intensities_file_name /=
"")
THEN
532 CALL cp_abort(__location__,
"[PERIODIC FIELD] Only one of INTENSITY, INTENSITY_LIST "// &
533 "or INTENSITIES_FILE_NAME can be specified.")
536 ALLOCATE (dft_control%period_efield%strength_list(
SIZE(pol)))
537 dft_control%period_efield%strength_list(1:
SIZE(pol)) = pol(1:
SIZE(pol))
540 IF (intensities_file_name /=
"")
THEN
542 IF (dft_control%period_efield%strength /= 0.0_dp)
THEN
543 CALL cp_abort(__location__,
"[PERIODIC FIELD] Only one of INTENSITY, INTENSITY_LIST "// &
544 "or INTENSITIES_FILE_NAME can be specified.")
557 cpabort(
"[PERIODIC FIELD] No intensities found in INTENSITIES_FILE_NAME")
560 ALLOCATE (dft_control%period_efield%strength_list(nrep))
565 READ (parser%input_line, *) dft_control%period_efield%strength_list(irep)
572 i_val=dft_control%period_efield%start_frame)
574 i_val=dft_control%period_efield%end_frame)
576 IF (dft_control%period_efield%end_frame /= -1)
THEN
580 IF (dft_control%period_efield%start_frame > dft_control%period_efield%end_frame)
THEN
581 cpabort(
"[PERIODIC FIELD] START_FRAME > END_FRAME")
582 ELSE IF (dft_control%period_efield%start_frame < 1)
THEN
583 cpabort(
"[PERIODIC FIELD] START_FRAME < 1")
584 ELSE IF (mod(dft_control%period_efield%end_frame - &
585 dft_control%period_efield%start_frame + 1,
SIZE(pol)) /= 0)
THEN
586 CALL cp_abort(__location__, &
587 "[PERIODIC FIELD] Number of active frames must be a multiple of the number of intensities")
592 cpassert(.NOT. do_rtp)
593 IF (dft_control%period_efield%displacement_field)
THEN
603 CALL section_vals_get(tmp_section, explicit=dft_control%apply_external_potential)
604 IF (dft_control%apply_external_potential)
THEN
607 l_val=dft_control%expot_control%read_from_cube)
609 l_val=dft_control%expot_control%static)
611 r_val=dft_control%expot_control%scaling_factor)
616 dft_control%expot_control%maxwell_solver = .true.
620 r_val=dft_control%maxwell_control%real_test)
622 i_val=dft_control%maxwell_control%int_test)
624 l_val=dft_control%maxwell_control%log_test)
626 dft_control%expot_control%maxwell_solver = .false.
636 l_val=dft_control%do_sccs)
637 IF (dft_control%do_sccs)
THEN
638 ALLOCATE (dft_control%sccs_control)
640 r_val=dft_control%sccs_control%epsilon_solvent)
642 r_val=dft_control%sccs_control%alpha_solvent)
644 r_val=dft_control%sccs_control%beta_solvent)
646 r_val=dft_control%sccs_control%delta_rho)
648 i_val=dft_control%sccs_control%derivative_method)
650 i_val=dft_control%sccs_control%method_id)
652 r_val=dft_control%sccs_control%eps_sccs)
654 r_val=dft_control%sccs_control%eps_scf)
656 r_val=dft_control%sccs_control%gamma_solvent)
658 i_val=dft_control%sccs_control%max_iter)
660 r_val=dft_control%sccs_control%mixing)
661 SELECT CASE (dft_control%sccs_control%method_id)
665 r_val=dft_control%sccs_control%rho_max)
667 r_val=dft_control%sccs_control%rho_min)
668 IF (dft_control%sccs_control%rho_max < dft_control%sccs_control%rho_min)
THEN
669 CALL cp_abort(__location__, &
670 "The SCCS parameter RHO_MAX is smaller than RHO_MIN. "// &
671 "Please, check your input!")
677 r_val=dft_control%sccs_control%beta)
678 IF (dft_control%sccs_control%beta < 0.5_dp)
THEN
679 CALL cp_abort(__location__, &
680 "A value smaller than 0.5 for the SCCS parameter beta "// &
681 "causes numerical problems. Please, check your input!")
684 r_val=dft_control%sccs_control%rho_zero)
687 cpabort(
"Invalid SCCS model specified. Please, check your input!")
696 CALL section_vals_get(tmp_section, explicit=dft_control%apply_external_density)
718 CHARACTER(len=*),
PARAMETER :: routinen =
'read_mgrid_section'
720 INTEGER :: handle, igrid_level, ngrid_level
721 LOGICAL :: explicit, multigrid_set
723 REAL(
dp),
DIMENSION(:),
POINTER :: cutofflist
726 CALL timeset(routinen, handle)
728 NULLIFY (mgrid_section, cutofflist)
734 CALL section_vals_val_get(mgrid_section,
"PROGRESSION_FACTOR", r_val=qs_control%progression_factor)
739 l_val=qs_control%skip_load_balance_distributed)
742 IF (qs_control%semi_empirical .OR. qs_control%dftb .OR. qs_control%xtb)
THEN
744 multigrid_set = .false.
747 IF (.NOT. explicit) cutoff = 1.0_dp
750 ALLOCATE (qs_control%e_cutoff(ngrid_level))
751 qs_control%cutoff = cutoff
753 IF (multigrid_set)
THEN
755 IF (qs_control%commensurate_mgrids)
THEN
756 cpabort(
"Do not specify cutoffs for the commensurate grids (NYI)")
760 IF (
ASSOCIATED(cutofflist))
THEN
761 IF (
SIZE(cutofflist, 1) /= ngrid_level)
THEN
762 cpabort(
"Number of multi-grids requested and number of cutoff values do not match")
764 DO igrid_level = 1, ngrid_level
765 qs_control%e_cutoff(igrid_level) = cutofflist(igrid_level)
769 DO igrid_level = ngrid_level, 1, -1
770 IF (qs_control%cutoff <= qs_control%e_cutoff(igrid_level))
THEN
771 qs_control%cutoff = qs_control%e_cutoff(igrid_level)
775 IF (igrid_level == 1)
THEN
776 qs_control%cutoff = qs_control%e_cutoff(1)
780 IF (qs_control%commensurate_mgrids) qs_control%progression_factor = 4.0_dp
781 qs_control%e_cutoff(1) = qs_control%cutoff
782 DO igrid_level = 2, ngrid_level
783 qs_control%e_cutoff(igrid_level) = qs_control%e_cutoff(igrid_level - 1)/ &
784 qs_control%progression_factor
788 DO igrid_level = 2, ngrid_level
789 IF (qs_control%e_cutoff(igrid_level) > qs_control%e_cutoff(igrid_level - 1))
THEN
790 cpabort(
"The cutoff values for the multi-grids are not ordered from large to small")
791 ELSE IF (qs_control%e_cutoff(igrid_level) == qs_control%e_cutoff(igrid_level - 1))
THEN
792 cpabort(
"The same cutoff value was specified for two multi-grids")
795 CALL timestop(handle)
808 CHARACTER(len=*),
PARAMETER :: routinen =
'read_qs_section'
810 CHARACTER(LEN=default_string_length) :: cval
811 CHARACTER(LEN=default_string_length), &
812 DIMENSION(:),
POINTER :: clist
813 INTEGER :: handle, itmp, j, jj, k, n_rep, n_var, &
815 INTEGER,
DIMENSION(:),
POINTER :: tmplist
816 LOGICAL :: explicit, was_present
817 REAL(
dp) :: tmp, tmpsqrt, value
818 REAL(
dp),
POINTER :: scal(:)
819 TYPE(
section_vals_type),
POINTER :: cdft_control_section, ddapc_restraint_section, &
820 dftb_parameter, dftb_section, eeq_section, genpot_section, lri_optbas_section, &
821 mull_section, nonbonded_section, s2_restraint_section, se_section, xtb_parameter, &
822 xtb_section, xtb_tblite
824 CALL timeset(routinen, handle)
826 was_present = .false.
827 NULLIFY (mull_section, ddapc_restraint_section, s2_restraint_section, &
828 se_section, dftb_section, xtb_section, dftb_parameter, xtb_parameter, lri_optbas_section, &
829 cdft_control_section, genpot_section, eeq_section)
849 tmpsqrt = sqrt(
value)
852 qs_control%eps_core_charge =
value/100.0_dp
855 qs_control%eps_pgf_orb = tmpsqrt
856 qs_control%eps_kg_orb = qs_control%eps_pgf_orb
858 qs_control%eps_ppnl = qs_control%eps_pgf_orb/100.0_dp
860 qs_control%eps_ppl = 1.0e-2_dp
862 qs_control%gapw_control%eps_cpc =
value
864 qs_control%eps_rho_gspace =
value
865 qs_control%eps_rho_rspace =
value
867 qs_control%eps_gvg_rspace = tmpsqrt
884 qs_control%eps_kg_orb = sqrt(tmp)
897 qs_control%eps_rho_rspace = qs_control%eps_rho_gspace
921 qs_control%gapw_control%lrho1_eq_lrho0 = .false.
922 qs_control%gapw_control%alpha0_hard_from_input = .false.
923 IF (qs_control%gapw_control%alpha0_hard /= 0.0_dp) qs_control%gapw_control%alpha0_hard_from_input = .true.
925 CALL section_vals_val_get(qs_section,
"MAX_RAD_LOCAL", r_val=qs_control%gapw_control%max_rad_local)
935 CALL section_vals_val_get(qs_section,
"CLUSTER_EMBED_SUBSYS", l_val=qs_control%cluster_embed_subsys)
936 CALL section_vals_val_get(qs_section,
"HIGH_LEVEL_EMBED_SUBSYS", l_val=qs_control%high_level_embed_subsys)
947 IF (qs_control%gapw_control%basis_1c /=
gapw_1c_orb)
THEN
948 qs_control%gapw_control%eps_svd = max(qs_control%gapw_control%eps_svd, 1.e-12_dp)
955 qs_control%pw_grid_opt%spherical = .true.
956 qs_control%pw_grid_opt%fullspace = .false.
958 qs_control%pw_grid_opt%spherical = .false.
959 qs_control%pw_grid_opt%fullspace = .true.
961 qs_control%pw_grid_opt%spherical = .false.
962 qs_control%pw_grid_opt%fullspace = .false.
967 qs_control%do_ppl_method = itmp
970 qs_control%pw_grid_opt%distribution_layout = tmplist
974 CALL section_vals_val_get(qs_section,
"EXTRAPOLATION", i_val=qs_control%wf_interpolation_method_nr)
975 CALL section_vals_val_get(qs_section,
"EXTRAPOLATION_ORDER", i_val=qs_control%wf_extrapolation_order)
979 qs_control%gapw = .false.
980 qs_control%gapw_xc = .false.
981 qs_control%gpw = .false.
982 qs_control%pao = .false.
983 qs_control%dftb = .false.
984 qs_control%xtb = .false.
985 qs_control%semi_empirical = .false.
986 qs_control%ofgpw = .false.
987 qs_control%lrigpw = .false.
988 qs_control%rigpw = .false.
989 SELECT CASE (qs_control%method_id)
993 qs_control%gapw = .true.
995 qs_control%gapw_xc = .true.
999 qs_control%gpw = .true.
1001 qs_control%ofgpw = .true.
1003 qs_control%lrigpw = .true.
1005 qs_control%rigpw = .true.
1007 qs_control%dftb = .true.
1011 qs_control%xtb = .true.
1016 qs_control%semi_empirical = .true.
1019 qs_control%semi_empirical = .true.
1022 qs_control%semi_empirical = .true.
1025 qs_control%semi_empirical = .true.
1028 qs_control%semi_empirical = .true.
1031 qs_control%semi_empirical = .true.
1034 qs_control%semi_empirical = .true.
1037 qs_control%semi_empirical = .true.
1041 qs_control%semi_empirical = .true.
1044 CALL section_vals_get(mull_section, explicit=qs_control%mulliken_restraint)
1046 IF (qs_control%mulliken_restraint)
THEN
1047 CALL section_vals_val_get(mull_section,
"STRENGTH", r_val=qs_control%mulliken_restraint_control%strength)
1048 CALL section_vals_val_get(mull_section,
"TARGET", r_val=qs_control%mulliken_restraint_control%target)
1053 jj = jj +
SIZE(tmplist)
1055 qs_control%mulliken_restraint_control%natoms = jj
1056 IF (qs_control%mulliken_restraint_control%natoms < 1) &
1057 cpabort(
"Need at least 1 atom to use mulliken constraints")
1058 ALLOCATE (qs_control%mulliken_restraint_control%atoms(qs_control%mulliken_restraint_control%natoms))
1062 DO j = 1,
SIZE(tmplist)
1064 qs_control%mulliken_restraint_control%atoms(jj) = tmplist(j)
1068 CALL section_vals_get(ddapc_restraint_section, n_repetition=nrep, explicit=qs_control%ddapc_restraint)
1069 IF (qs_control%ddapc_restraint)
THEN
1070 ALLOCATE (qs_control%ddapc_restraint_control(nrep))
1072 qs_control%ddapc_restraint_is_spin = .false.
1073 qs_control%ddapc_explicit_potential = .false.
1076 CALL section_vals_get(s2_restraint_section, explicit=qs_control%s2_restraint)
1077 IF (qs_control%s2_restraint)
THEN
1079 r_val=qs_control%s2_restraint_control%strength)
1081 r_val=qs_control%s2_restraint_control%target)
1083 i_val=qs_control%s2_restraint_control%functional_form)
1087 IF (qs_control%cdft)
THEN
1092 IF (qs_control%semi_empirical)
THEN
1094 l_val=qs_control%se_control%orthogonal_basis)
1096 r_val=qs_control%se_control%delta)
1098 l_val=qs_control%se_control%analytical_gradients)
1100 l_val=qs_control%se_control%force_kdsod_EX)
1103 i_val=qs_control%se_control%integral_screening)
1106 CALL cp_warn(__location__, &
1107 "PNNL semi-empirical parameterization supports only the Slater type "// &
1108 "integral scheme. Revert to Slater and continue the calculation.")
1113 i_val=qs_control%se_control%ga_ncells)
1116 r_val=qs_control%se_control%cutoff_lrc)
1117 qs_control%se_control%taper_lrc = qs_control%se_control%cutoff_lrc
1122 r_val=qs_control%se_control%taper_lrc)
1125 r_val=qs_control%se_control%range_lrc)
1128 r_val=qs_control%se_control%cutoff_cou)
1129 qs_control%se_control%taper_cou = qs_control%se_control%cutoff_cou
1134 r_val=qs_control%se_control%taper_cou)
1137 r_val=qs_control%se_control%range_cou)
1140 r_val=qs_control%se_control%cutoff_exc)
1141 qs_control%se_control%taper_exc = qs_control%se_control%cutoff_exc
1146 r_val=qs_control%se_control%taper_exc)
1149 r_val=qs_control%se_control%range_exc)
1153 r_val=qs_control%se_control%taper_scr)
1155 r_val=qs_control%se_control%range_scr)
1159 i_val=qs_control%se_control%periodic_type)
1160 SELECT CASE (qs_control%se_control%periodic_type)
1162 qs_control%se_control%do_ewald = .false.
1163 qs_control%se_control%do_ewald_r3 = .false.
1164 qs_control%se_control%do_ewald_gks = .false.
1166 qs_control%se_control%do_ewald = .true.
1167 qs_control%se_control%do_ewald_r3 = .false.
1168 qs_control%se_control%do_ewald_gks = .false.
1170 qs_control%se_control%do_ewald = .false.
1171 qs_control%se_control%do_ewald_r3 = .false.
1172 qs_control%se_control%do_ewald_gks = .true.
1174 CALL cp_abort(__location__, &
1175 "A periodic semi-empirical calculation was requested with a long-range "// &
1176 "summation on the single integral evaluation. This scheme is supported "// &
1177 "only by the PNNL parameterization.")
1179 qs_control%se_control%do_ewald = .true.
1180 qs_control%se_control%do_ewald_r3 = .true.
1181 qs_control%se_control%do_ewald_gks = .false.
1182 IF (qs_control%se_control%integral_screening /=
do_se_is_kdso) &
1183 CALL cp_abort(__location__, &
1184 "A periodic semi-empirical calculation was requested with a long-range "// &
1185 "summation for the slowly convergent part 1/R^3, which is not congruent "// &
1186 "with the integral screening chosen. The only integral screening supported "// &
1187 "by this periodic type calculation is the standard Klopman-Dewar-Sabelli-Ohno.")
1192 l_val=qs_control%se_control%dispersion)
1194 r_val=qs_control%se_control%rcdisp)
1196 r_val=qs_control%se_control%epscn)
1198 qs_control%se_control%sd3(1) = scal(1)
1199 qs_control%se_control%sd3(2) = scal(2)
1200 qs_control%se_control%sd3(3) = scal(3)
1202 c_val=qs_control%se_control%dispersion_parameter_file)
1206 cpabort(
"EWALD_R3 not implemented yet!")
1218 qs_control%se_control%orthogonal_basis = .true.
1223 IF (qs_control%dftb)
THEN
1225 l_val=qs_control%dftb_control%orthogonal_basis)
1227 l_val=qs_control%dftb_control%self_consistent)
1229 l_val=qs_control%dftb_control%dispersion)
1231 l_val=qs_control%dftb_control%dftb3_diagonal)
1233 l_val=qs_control%dftb_control%hb_sr_damp)
1235 r_val=qs_control%dftb_control%eps_disp)
1239 l_val=qs_control%dftb_control%do_ewald)
1241 qs_control%dftb_control%do_ewald = (qs_control%periodicity /= 0)
1244 c_val=qs_control%dftb_control%sk_file_path)
1246 c_val=qs_control%dftb_control%sk_file_list)
1248 r_val=qs_control%dftb_control%hb_sr_para)
1250 ALLOCATE (qs_control%dftb_control%sk_pair_list(3, n_var))
1254 qs_control%dftb_control%sk_pair_list(1:3, k) = clist(1:3)
1258 i_val=qs_control%dftb_control%dispersion_type)
1260 c_val=qs_control%dftb_control%uff_force_field)
1263 r_val=qs_control%dftb_control%rcdisp)
1265 r_val=qs_control%dftb_control%epscn)
1267 r_val=qs_control%dftb_control%exp_pre)
1269 r_val=qs_control%dftb_control%scaling)
1271 qs_control%dftb_control%sd3(1) = scal(1)
1272 qs_control%dftb_control%sd3(2) = scal(2)
1273 qs_control%dftb_control%sd3(3) = scal(3)
1275 qs_control%dftb_control%sd3bj(1) = scal(1)
1276 qs_control%dftb_control%sd3bj(2) = scal(2)
1277 qs_control%dftb_control%sd3bj(3) = scal(3)
1278 qs_control%dftb_control%sd3bj(4) = scal(4)
1280 c_val=qs_control%dftb_control%dispersion_parameter_file)
1282 IF (qs_control%dftb_control%dispersion)
CALL cite_reference(
zhechkov2005)
1283 IF (qs_control%dftb_control%self_consistent)
CALL cite_reference(
elstner1998)
1284 IF (qs_control%dftb_control%hb_sr_damp)
CALL cite_reference(
hu2007)
1288 IF (qs_control%xtb)
THEN
1293 l_val=qs_control%xtb_control%do_ewald)
1295 qs_control%xtb_control%do_ewald = (qs_control%periodicity /= 0)
1313 SELECT CASE (qs_control%xtb_control%gfn_type)
1320 cpabort(
"gfn2-xtb tbd")
1327 qs_control%xtb_control%sto_ng = ngauss
1329 qs_control%xtb_control%h_sto_ng = ngauss
1331 c_val=qs_control%xtb_control%parameter_file_path)
1335 c_val=qs_control%xtb_control%parameter_file_name)
1337 SELECT CASE (qs_control%xtb_control%gfn_type)
1339 qs_control%xtb_control%parameter_file_name =
"xTB0_parameters"
1341 qs_control%xtb_control%parameter_file_name =
"xTB1_parameters"
1343 cpabort(
"gfn2-xtb tbd")
1350 r_val=qs_control%xtb_control%rcdisp)
1352 r_val=qs_control%xtb_control%epscn)
1356 qs_control%xtb_control%s6 = scal(1)
1357 qs_control%xtb_control%s8 = scal(2)
1359 SELECT CASE (qs_control%xtb_control%gfn_type)
1361 qs_control%xtb_control%s6 = 1.00_dp
1362 qs_control%xtb_control%s8 = 2.85_dp
1364 qs_control%xtb_control%s6 = 1.00_dp
1365 qs_control%xtb_control%s8 = 2.40_dp
1367 cpabort(
"gfn2-xtb tbd")
1375 qs_control%xtb_control%a1 = scal(1)
1376 qs_control%xtb_control%a2 = scal(2)
1378 SELECT CASE (qs_control%xtb_control%gfn_type)
1380 qs_control%xtb_control%a1 = 0.80_dp
1381 qs_control%xtb_control%a2 = 4.60_dp
1383 qs_control%xtb_control%a1 = 0.63_dp
1384 qs_control%xtb_control%a2 = 5.00_dp
1386 cpabort(
"gfn2-xtb tbd")
1392 c_val=qs_control%xtb_control%dispersion_parameter_file)
1397 qs_control%xtb_control%ks = scal(1)
1398 qs_control%xtb_control%kp = scal(2)
1399 qs_control%xtb_control%kd = scal(3)
1400 qs_control%xtb_control%ksp = scal(4)
1401 qs_control%xtb_control%k2sh = scal(5)
1402 IF (qs_control%xtb_control%gfn_type == 0)
THEN
1404 qs_control%xtb_control%ksp = 0.5_dp*(scal(1) + scal(2))
1407 SELECT CASE (qs_control%xtb_control%gfn_type)
1409 qs_control%xtb_control%ks = 2.00_dp
1410 qs_control%xtb_control%kp = 2.4868_dp
1411 qs_control%xtb_control%kd = 2.27_dp
1412 qs_control%xtb_control%ksp = 2.2434_dp
1413 qs_control%xtb_control%k2sh = 1.1241_dp
1415 qs_control%xtb_control%ks = 1.85_dp
1416 qs_control%xtb_control%kp = 2.25_dp
1417 qs_control%xtb_control%kd = 2.00_dp
1418 qs_control%xtb_control%ksp = 2.08_dp
1419 qs_control%xtb_control%k2sh = 2.85_dp
1421 cpabort(
"gfn2-xtb tbd")
1429 qs_control%xtb_control%kg = scal(1)
1430 qs_control%xtb_control%kf = scal(2)
1432 SELECT CASE (qs_control%xtb_control%gfn_type)
1434 qs_control%xtb_control%kg = 2.00_dp
1435 qs_control%xtb_control%kf = 1.50_dp
1437 qs_control%xtb_control%kg = 2.00_dp
1438 qs_control%xtb_control%kf = 1.50_dp
1440 cpabort(
"gfn2-xtb tbd")
1446 qs_control%xtb_control%kcns = scal(1)
1447 qs_control%xtb_control%kcnp = scal(2)
1448 qs_control%xtb_control%kcnd = scal(3)
1453 SELECT CASE (qs_control%xtb_control%gfn_type)
1455 qs_control%xtb_control%ksen = scal(1)
1456 qs_control%xtb_control%kpen = scal(2)
1457 qs_control%xtb_control%kden = scal(3)
1459 qs_control%xtb_control%ken = scal(1)
1461 cpabort(
"gfn2-xtb tbd")
1466 SELECT CASE (qs_control%xtb_control%gfn_type)
1468 qs_control%xtb_control%ksen = 0.006_dp
1469 qs_control%xtb_control%kpen = -0.001_dp
1470 qs_control%xtb_control%kden = -0.002_dp
1472 qs_control%xtb_control%ken = -0.007_dp
1474 cpabort(
"gfn2-xtb tbd")
1481 qs_control%xtb_control%ben = scal(1)
1486 r_val=qs_control%xtb_control%enscale)
1488 SELECT CASE (qs_control%xtb_control%gfn_type)
1490 qs_control%xtb_control%enscale = -0.09_dp
1492 qs_control%xtb_control%enscale = 0._dp
1494 cpabort(
"gfn2-xtb tbd")
1501 l_val=qs_control%xtb_control%xb_interaction)
1503 qs_control%xtb_control%kxr = scal(1)
1504 qs_control%xtb_control%kx2 = scal(2)
1507 l_val=qs_control%xtb_control%do_nonbonded)
1509 IF (explicit .AND. qs_control%xtb_control%do_nonbonded)
THEN
1513 CALL read_gp_section(qs_control%xtb_control%nonbonded, genpot_section, 0)
1517 r_val=qs_control%xtb_control%eps_pair)
1520 qs_control%xtb_control%coulomb_sr_cut = scal(1)
1522 qs_control%xtb_control%coulomb_sr_eps = scal(1)
1528 SELECT CASE (qs_control%xtb_control%gfn_type)
1530 qs_control%xtb_control%coulomb_interaction = .false.
1531 qs_control%xtb_control%coulomb_lr = .false.
1532 qs_control%xtb_control%tb3_interaction = .false.
1533 qs_control%xtb_control%check_atomic_charges = .false.
1535 l_val=qs_control%xtb_control%var_dipole)
1539 l_val=qs_control%xtb_control%coulomb_interaction)
1541 l_val=qs_control%xtb_control%coulomb_lr)
1543 l_val=qs_control%xtb_control%tb3_interaction)
1546 l_val=qs_control%xtb_control%check_atomic_charges)
1547 qs_control%xtb_control%var_dipole = .false.
1549 cpabort(
"gfn2-xtb tbd")
1553 qs_control%xtb_control%kab_nval = n_rep
1555 ALLOCATE (qs_control%xtb_control%kab_param(3, n_rep))
1556 ALLOCATE (qs_control%xtb_control%kab_types(2, n_rep))
1557 ALLOCATE (qs_control%xtb_control%kab_vals(n_rep))
1560 qs_control%xtb_control%kab_param(1, j) = clist(1)
1562 ielement=qs_control%xtb_control%kab_types(1, j))
1563 qs_control%xtb_control%kab_param(2, j) = clist(2)
1565 ielement=qs_control%xtb_control%kab_types(2, j))
1566 qs_control%xtb_control%kab_param(3, j) = clist(3)
1567 READ (clist(3),
'(F10.0)') qs_control%xtb_control%kab_vals(j)
1571 IF (qs_control%xtb_control%gfn_type == 0)
THEN
1573 qs_control%xtb_control%ksrb = scal(1)
1574 qs_control%xtb_control%esrb = scal(2)
1575 qs_control%xtb_control%gscal = scal(3)
1576 qs_control%xtb_control%c1srb = scal(4)
1577 qs_control%xtb_control%c2srb = scal(5)
1578 qs_control%xtb_control%shift = scal(6)
1583 SELECT CASE (trim(cval))
1585 qs_control%xtb_control%enshift_type = 0
1587 qs_control%xtb_control%enshift_type = 1
1589 qs_control%xtb_control%enshift_type = 2
1591 cpabort(
"Unknown value for EN_SHIFT_TYPE")
1595 CALL read_eeq_param(eeq_section, qs_control%xtb_control%eeq_sparam)
1604 l_val=qs_control%xtb_control%do_tblite)
1606 i_val=qs_control%xtb_control%tblite_method)
1607 IF (qs_control%xtb_control%do_tblite)
THEN
1614 qs_control%xtb_control%do_ewald = .false.
1617 CALL timestop(handle)
1631 CHARACTER(LEN=*),
PARAMETER :: routinen =
'read_tddfpt2_control'
1633 CHARACTER(LEN=default_string_length), &
1634 DIMENSION(:),
POINTER :: tmpstringlist
1635 INTEGER :: handle, irep, isize, nrep
1636 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: inds
1637 LOGICAL :: do_ewald, do_exchange, expl, explicit, &
1639 REAL(kind=
dp) :: filter, fval, hfx
1641 soc_section, stda_section, xc_func, &
1644 CALL timeset(routinen, handle)
1659 CALL section_vals_val_get(t_section,
"MIN_AMPLITUDE", r_val=t_control%min_excitation_amplitude)
1666 CALL section_vals_val_get(t_section,
"ADMM_KERNEL_CORRECTION_SYMMETRIC", l_val=t_control%admm_symm)
1667 CALL section_vals_val_get(t_section,
"ADMM_KERNEL_XC_CORRECTION", l_val=t_control%admm_xc_correction)
1668 CALL section_vals_val_get(t_section,
"EXCITON_DESCRIPTORS", l_val=t_control%do_exciton_descriptors)
1669 CALL section_vals_val_get(t_section,
"DIRECTIONAL_EXCITON_DESCRIPTORS", l_val=t_control%do_directional_exciton_descriptors)
1675 IF (
SIZE(tmpstringlist) == 2)
THEN
1677 SELECT CASE (tmpstringlist(2))
1689 cpabort(
"Unknown basis size in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
1692 SELECT CASE (tmpstringlist(1))
1695 t_control%auto_basis_p_lri_aux = isize
1697 cpabort(
"Unknown basis type in AUTO_BASIS keyword:"//trim(tmpstringlist(1)))
1700 CALL cp_abort(__location__, &
1701 "AUTO_BASIS keyword in &PROPERTIES &TDDFT section has a wrong number of arguments.")
1705 IF (t_control%conv < 0) &
1706 t_control%conv = abs(t_control%conv)
1714 t_control%dipole_form = 0
1719 CALL section_vals_val_get(dipole_section,
"REFERENCE_POINT", r_vals=t_control%dipole_ref_point)
1721 NULLIFY (t_control%dipole_ref_point)
1723 cpabort(
"User-defined reference point should be given explicitly")
1731 t_control%do_soc = .true.
1738 IF (t_control%mgrid_is_explicit)
THEN
1739 CALL section_vals_val_get(mgrid_section,
"NGRIDS", i_val=t_control%mgrid_ngrids, explicit=explicit)
1740 IF (.NOT. explicit) t_control%mgrid_ngrids =
SIZE(qs_control%e_cutoff)
1742 CALL section_vals_val_get(mgrid_section,
"CUTOFF", r_val=t_control%mgrid_cutoff, explicit=explicit)
1743 IF (.NOT. explicit) t_control%mgrid_cutoff = qs_control%cutoff
1746 r_val=t_control%mgrid_progression_factor, explicit=explicit)
1748 IF (t_control%mgrid_progression_factor <= 1.0_dp) &
1749 CALL cp_abort(__location__, &
1750 "Progression factor should be greater then 1.0 to ensure multi-grid ordering")
1752 t_control%mgrid_progression_factor = qs_control%progression_factor
1755 CALL section_vals_val_get(mgrid_section,
"COMMENSURATE", l_val=t_control%mgrid_commensurate_mgrids, explicit=explicit)
1756 IF (.NOT. explicit) t_control%mgrid_commensurate_mgrids = qs_control%commensurate_mgrids
1757 IF (t_control%mgrid_commensurate_mgrids)
THEN
1759 t_control%mgrid_progression_factor = 4.0_dp
1761 t_control%mgrid_progression_factor = qs_control%progression_factor
1765 CALL section_vals_val_get(mgrid_section,
"REL_CUTOFF", r_val=t_control%mgrid_relative_cutoff, explicit=explicit)
1766 IF (.NOT. explicit) t_control%mgrid_relative_cutoff = qs_control%relative_cutoff
1768 CALL section_vals_val_get(mgrid_section,
"MULTIGRID_SET", l_val=multigrid_set, explicit=explicit)
1769 IF (.NOT. explicit) multigrid_set = .false.
1770 IF (multigrid_set)
THEN
1773 NULLIFY (t_control%mgrid_e_cutoff)
1776 CALL section_vals_val_get(mgrid_section,
"REALSPACE", l_val=t_control%mgrid_realspace_mgrids, explicit=explicit)
1777 IF (.NOT. explicit) t_control%mgrid_realspace_mgrids = qs_control%realspace_mgrids
1780 l_val=t_control%mgrid_skip_load_balance, explicit=explicit)
1781 IF (.NOT. explicit) t_control%mgrid_skip_load_balance = qs_control%skip_load_balance_distributed
1783 IF (
ASSOCIATED(t_control%mgrid_e_cutoff))
THEN
1784 IF (
SIZE(t_control%mgrid_e_cutoff) /= t_control%mgrid_ngrids) &
1785 cpabort(
"Inconsistent values for number of multi-grids")
1788 t_control%mgrid_e_cutoff = -t_control%mgrid_e_cutoff
1789 ALLOCATE (inds(t_control%mgrid_ngrids))
1790 CALL sort(t_control%mgrid_e_cutoff, t_control%mgrid_ngrids, inds)
1792 t_control%mgrid_e_cutoff = -t_control%mgrid_e_cutoff
1806 t_control%stda_control%hfx_fraction = 0.0_dp
1807 t_control%stda_control%do_exchange = .true.
1808 t_control%stda_control%eps_td_filter = 1.e-10_dp
1809 t_control%stda_control%mn_alpha = -99.0_dp
1810 t_control%stda_control%mn_beta = -99.0_dp
1812 SELECT CASE (qs_control%periodicity)
1814 t_control%stda_control%do_ewald = .false.
1816 t_control%stda_control%do_ewald = .true.
1818 t_control%stda_control%do_ewald = .true.
1820 t_control%stda_control%do_ewald = .true.
1822 cpabort(
"Illegal value for periodiciy")
1827 IF (expl) t_control%stda_control%hfx_fraction = hfx
1829 IF (expl) t_control%stda_control%eps_td_filter = filter
1831 IF (expl) t_control%stda_control%do_ewald = do_ewald
1833 IF (expl) t_control%stda_control%do_exchange = do_exchange
1835 t_control%stda_control%mn_alpha = fval
1837 t_control%stda_control%mn_beta = fval
1840 t_control%stda_control%coulomb_sr_cut = fval
1842 t_control%stda_control%coulomb_sr_eps = fval
1845 CALL timestop(handle)
1857 CHARACTER(len=*),
PARAMETER :: routinen =
'write_dft_control'
1859 CHARACTER(LEN=20) :: tmpstr
1860 INTEGER :: handle, i, i_rep, n_rep, output_unit
1861 REAL(kind=
dp) :: density_cut, density_smooth_cut_range, &
1862 gradient_cut, tau_cut
1869 IF (dft_control%qs_control%semi_empirical)
RETURN
1870 IF (dft_control%qs_control%dftb)
RETURN
1871 IF (dft_control%qs_control%xtb)
THEN
1872 CALL write_xtb_control(dft_control%qs_control%xtb_control, dft_section)
1875 CALL timeset(routinen, handle)
1881 "PRINT%DFT_CONTROL_PARAMETERS", extension=
".Log")
1883 IF (output_unit > 0)
THEN
1887 IF (dft_control%uks)
THEN
1888 WRITE (unit=output_unit, fmt=
"(/,T2,A,T78,A)") &
1889 "DFT| Spin unrestricted (spin-polarized) Kohn-Sham calculation",
"UKS"
1890 ELSE IF (dft_control%roks)
THEN
1891 WRITE (unit=output_unit, fmt=
"(/,T2,A,T77,A)") &
1892 "DFT| Spin restricted open Kohn-Sham calculation",
"ROKS"
1894 WRITE (unit=output_unit, fmt=
"(/,T2,A,T78,A)") &
1895 "DFT| Spin restricted Kohn-Sham (RKS) calculation",
"RKS"
1898 WRITE (unit=output_unit, fmt=
"(T2,A,T76,I5)") &
1899 "DFT| Multiplicity", dft_control%multiplicity
1900 WRITE (unit=output_unit, fmt=
"(T2,A,T76,I5)") &
1901 "DFT| Number of spin states", dft_control%nspins
1903 WRITE (unit=output_unit, fmt=
"(T2,A,T76,I5)") &
1904 "DFT| Charge", dft_control%charge
1907 SELECT CASE (dft_control%sic_method_id)
1911 tmpstr =
"SPZ/MAURI SIC"
1913 tmpstr =
"US/MAURI SIC"
1917 tmpstr =
"Explicit Orbital SIC"
1920 cpabort(
"SIC option unknown")
1923 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
1924 "DFT| Self-interaction correction (SIC)", adjustr(trim(tmpstr))
1926 IF (dft_control%sic_method_id /=
sic_none)
THEN
1927 WRITE (unit=output_unit, fmt=
"(T2,A,T66,ES15.6)") &
1928 "DFT| SIC scaling parameter a", dft_control%sic_scaling_a, &
1929 "DFT| SIC scaling parameter b", dft_control%sic_scaling_b
1932 IF (dft_control%sic_method_id ==
sic_eo)
THEN
1934 WRITE (unit=output_unit, fmt=
"(T2,A,T66,A)") &
1935 "DFT| SIC orbitals",
"ALL"
1938 WRITE (unit=output_unit, fmt=
"(T2,A,T66,A)") &
1939 "DFT| SIC orbitals",
"UNPAIRED"
1946 CALL section_vals_val_get(xc_section,
"density_smooth_cutoff_range", r_val=density_smooth_cut_range)
1948 WRITE (unit=output_unit, fmt=
"(T2,A,T66,ES15.6)") &
1949 "DFT| Cutoffs: density ", density_cut, &
1950 "DFT| gradient", gradient_cut, &
1951 "DFT| tau ", tau_cut, &
1952 "DFT| cutoff_smoothing_range", density_smooth_cut_range
1955 WRITE (output_unit,
'( A, T61, A )') &
1956 " DFT| XC density smoothing ", adjustr(tmpstr)
1959 WRITE (output_unit,
'( A, T61, A )') &
1960 " DFT| XC derivatives ", adjustr(tmpstr)
1961 IF (dft_control%dft_plus_u)
THEN
1962 NULLIFY (enum, keyword, section)
1966 WRITE (unit=output_unit, fmt=
"(/,T2,A,T41,A40)") &
1967 "DFT+U| Method", adjustr(trim(
enum_i2c(enum, dft_control%plus_u_method_id)))
1968 WRITE (unit=output_unit, fmt=
"(T2,A)") &
1969 "DFT+U| Check atomic kind information for details"
1973 WRITE (unit=output_unit, fmt=
"(A)")
""
1974 CALL xc_write(output_unit, xc_section, dft_control%lsd)
1976 IF (dft_control%apply_period_efield)
THEN
1977 WRITE (unit=output_unit, fmt=
"(A)")
""
1978 IF (dft_control%period_efield%displacement_field)
THEN
1979 WRITE (unit=output_unit, fmt=
"(T2,A)") &
1980 "PERIODIC_EFIELD| Use displacement field formulation"
1981 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,ES14.6)") &
1982 "PERIODIC_EFIELD| Displacement field filter: x", &
1983 dft_control%period_efield%d_filter(1), &
1984 "PERIODIC_EFIELD| y", &
1985 dft_control%period_efield%d_filter(2), &
1986 "PERIODIC_EFIELD| z", &
1987 dft_control%period_efield%d_filter(3)
1989 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,ES14.6)") &
1990 "PERIODIC_EFIELD| Polarisation vector: x", &
1991 dft_control%period_efield%polarisation(1), &
1992 "PERIODIC_EFIELD| y", &
1993 dft_control%period_efield%polarisation(2), &
1994 "PERIODIC_EFIELD| z", &
1995 dft_control%period_efield%polarisation(3)
1997 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,I14)") &
1998 "PERIODIC_EFIELD| Start Frame:", &
1999 dft_control%period_efield%start_frame, &
2000 "PERIODIC_EFIELD| End Frame:", &
2001 dft_control%period_efield%end_frame
2003 IF (
ALLOCATED(dft_control%period_efield%strength_list))
THEN
2004 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,I14)") &
2005 "PERIODIC_EFIELD| Number of Intensities:", &
2006 SIZE(dft_control%period_efield%strength_list)
2007 WRITE (unit=output_unit, fmt=
"(T2,A,I10,T66,1X,ES14.6)") &
2008 "PERIODIC_EFIELD| Intensity List [a.u.] ", &
2009 1, dft_control%period_efield%strength_list(1)
2010 DO i = 2,
SIZE(dft_control%period_efield%strength_list)
2011 WRITE (unit=output_unit, fmt=
"(T2,A,I10,T66,1X,ES14.6)") &
2012 "PERIODIC_EFIELD| ", &
2013 i, dft_control%period_efield%strength_list(i)
2016 WRITE (unit=output_unit, fmt=
"(T2,A,T66,1X,ES14.6)") &
2017 "PERIODIC_EFIELD| Intensity [a.u.]:", &
2018 dft_control%period_efield%strength
2021 IF (sqrt(dot_product(dft_control%period_efield%polarisation, &
2022 dft_control%period_efield%polarisation)) < epsilon(0.0_dp))
THEN
2023 cpabort(
"Invalid (too small) polarisation vector specified for PERIODIC_EFIELD")
2027 IF (dft_control%do_sccs)
THEN
2028 WRITE (unit=output_unit, fmt=
"(/,T2,A)") &
2029 "SCCS| Self-consistent continuum solvation model"
2030 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2031 "SCCS| Relative permittivity of the solvent (medium)", &
2032 dft_control%sccs_control%epsilon_solvent, &
2033 "SCCS| Absolute permittivity [a.u.]", &
2034 dft_control%sccs_control%epsilon_solvent/
fourpi
2035 SELECT CASE (dft_control%sccs_control%method_id)
2037 WRITE (unit=output_unit, fmt=
"(T2,A,/,(T2,A,T61,ES20.6))") &
2038 "SCCS| Dielectric function proposed by Andreussi et al.", &
2039 "SCCS| rho_max", dft_control%sccs_control%rho_max, &
2040 "SCCS| rho_min", dft_control%sccs_control%rho_min
2042 WRITE (unit=output_unit, fmt=
"(T2,A,/,(T2,A,T61,ES20.6))") &
2043 "SCCS| Dielectric function proposed by Fattebert and Gygi", &
2044 "SCCS| beta", dft_control%sccs_control%beta, &
2045 "SCCS| rho_zero", dft_control%sccs_control%rho_zero
2047 cpabort(
"Invalid SCCS model specified. Please, check your input!")
2049 SELECT CASE (dft_control%sccs_control%derivative_method)
2051 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2052 "SCCS| Numerical derivative calculation", &
2055 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2056 "SCCS| Numerical derivative calculation", &
2057 adjustr(
"3-point stencil central differences")
2059 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2060 "SCCS| Numerical derivative calculation", &
2061 adjustr(
"5-point stencil central differences")
2063 WRITE (unit=output_unit, fmt=
"(T2,A,T46,A35)") &
2064 "SCCS| Numerical derivative calculation", &
2065 adjustr(
"7-point stencil central differences")
2067 CALL cp_abort(__location__, &
2068 "Invalid derivative method specified for SCCS model. "// &
2069 "Please, check your input!")
2071 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2072 "SCCS| Repulsion parameter alpha [mN/m] = [dyn/cm]", &
2074 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2075 "SCCS| Dispersion parameter beta [GPa]", &
2077 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2078 "SCCS| Surface tension gamma [mN/m] = [dyn/cm]", &
2080 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2081 "SCCS| Mixing parameter applied during the iteration cycle", &
2082 dft_control%sccs_control%mixing
2083 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2084 "SCCS| Tolerance for the convergence of the SCCS iteration cycle", &
2085 dft_control%sccs_control%eps_sccs
2086 WRITE (unit=output_unit, fmt=
"(T2,A,T61,I20)") &
2087 "SCCS| Maximum number of iteration steps", &
2088 dft_control%sccs_control%max_iter
2089 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2090 "SCCS| SCF convergence threshold for starting the SCCS iteration", &
2091 dft_control%sccs_control%eps_scf
2092 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2093 "SCCS| Numerical increment for the cavity surface calculation", &
2094 dft_control%sccs_control%delta_rho
2097 WRITE (unit=output_unit, fmt=
"(A)")
""
2101 IF (dft_control%hairy_probes .EQV. .true.)
THEN
2102 n_rep =
SIZE(dft_control%probe)
2103 IF (output_unit > 0)
THEN
2105 WRITE (unit=output_unit, fmt=
"(T2,A,I5)") &
2106 "HP | hair probe set", i_rep
2107 WRITE (unit=output_unit, fmt=
"(T2,A,T61,*(I5))") &
2108 "HP| atom indexes", &
2109 (dft_control%probe(i_rep)%atom_ids(i), i=1, dft_control%probe(i_rep)%natoms)
2110 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2111 "HP| potential", dft_control%probe(i_rep)%mu
2112 WRITE (unit=output_unit, fmt=
"(T2,A,T61,F20.2)") &
2113 "HP| temperature", dft_control%probe(i_rep)%T
2114 WRITE (unit=output_unit, fmt=
"(T2,A,T61,ES20.6)") &
2115 "HP| eps_hp", dft_control%probe(i_rep)%eps_hp
2121 "PRINT%DFT_CONTROL_PARAMETERS")
2123 CALL timestop(handle)
2143 "PRINT%DFT_CONTROL_PARAMETERS", extension=
".Log")
2145 IF (iounit > 0)
THEN
2147 SELECT CASE (admm_control%admm_type)
2149 WRITE (unit=iounit, fmt=
"(/,T2,A,T77,A)")
"ADMM| Specific ADMM type specified",
"NONE"
2151 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMM1"
2153 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMM2"
2155 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMMS"
2157 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMMP"
2159 WRITE (unit=iounit, fmt=
"(/,T2,A,T76,A)")
"ADMM| Specific ADMM type specified",
"ADMMQ"
2161 cpabort(
"admm_type")
2164 SELECT CASE (admm_control%purification_method)
2166 WRITE (unit=iounit, fmt=
"(T2,A,T77,A)")
"ADMM| Density matrix purification method",
"NONE"
2168 WRITE (unit=iounit, fmt=
"(T2,A,T75,A)")
"ADMM| Density matrix purification method",
"Cauchy"
2170 WRITE (unit=iounit, fmt=
"(T2,A,T66,A)")
"ADMM| Density matrix purification method",
"Cauchy subspace"
2172 WRITE (unit=iounit, fmt=
"(T2,A,T63,A)")
"ADMM| Density matrix purification method",
"MO diagonalization"
2174 WRITE (unit=iounit, fmt=
"(T2,A,T71,A)")
"ADMM| Density matrix purification method",
"MO no diag"
2176 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Density matrix purification method",
"McWeeny"
2178 WRITE (unit=iounit, fmt=
"(T2,A,T73,A)")
"ADMM| Density matrix purification method",
"NONE(DM)"
2180 cpabort(
"admm_purification_method")
2183 SELECT CASE (admm_control%method)
2185 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Orbital projection on ADMM basis"
2187 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Blocked Fock matrix projection with full purification"
2189 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Blocked Fock matrix projection"
2191 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Orbital projection with charge constrain"
2193 cpabort(
"admm method")
2196 SELECT CASE (admm_control%scaling_model)
2199 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| Use Merlot (2014) scaling model"
2201 cpabort(
"admm scaling_model")
2204 WRITE (unit=iounit, fmt=
"(T2,A,T61,G20.10)")
"ADMM| eps_filter", admm_control%eps_filter
2206 SELECT CASE (admm_control%aux_exch_func)
2208 WRITE (unit=iounit, fmt=
"(T2,A)")
"ADMM| No exchange functional correction term used"
2210 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Exchange functional in correction term",
"(W)PBEX"
2212 WRITE (unit=iounit, fmt=
"(T2,A,T77,A)")
"ADMM| Exchange functional in correction term",
"PBEX"
2214 WRITE (unit=iounit, fmt=
"(T2,A,T77,A)")
"ADMM| Exchange functional in correction term",
"OPTX"
2216 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Exchange functional in correction term",
"Becke88"
2218 WRITE (unit=iounit, fmt=
"(T2,A,T74,A)")
"ADMM| Exchange functional in correction term",
"SlaterX"
2220 cpabort(
"admm aux_exch_func")
2223 WRITE (unit=iounit, fmt=
"(A)")
""
2228 "PRINT%DFT_CONTROL_PARAMETERS")
2236 SUBROUTINE write_xtb_control(xtb_control, dft_section)
2240 CHARACTER(len=*),
PARAMETER :: routinen =
'write_xtb_control'
2242 INTEGER :: handle, output_unit
2245 CALL timeset(routinen, handle)
2250 "PRINT%DFT_CONTROL_PARAMETERS", extension=
".Log")
2252 IF (output_unit > 0)
THEN
2254 WRITE (unit=output_unit, fmt=
"(/,T2,A,T31,A50)") &
2255 "xTB| Parameter file", adjustr(trim(xtb_control%parameter_file_name))
2256 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2257 "xTB| Basis expansion STO-NG", xtb_control%sto_ng
2258 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2259 "xTB| Basis expansion STO-NG for Hydrogen", xtb_control%h_sto_ng
2260 WRITE (unit=output_unit, fmt=
"(T2,A,T71,E10.4)") &
2261 "xTB| Repulsive pair potential accuracy", xtb_control%eps_pair
2262 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.6)") &
2263 "xTB| Repulsive enhancement factor", xtb_control%enscale
2264 WRITE (unit=output_unit, fmt=
"(T2,A,T71,L10)") &
2265 "xTB| Halogen interaction potential", xtb_control%xb_interaction
2266 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2267 "xTB| Halogen interaction potential cutoff radius", xtb_control%xb_radius
2268 WRITE (unit=output_unit, fmt=
"(T2,A,T71,L10)") &
2269 "xTB| Nonbonded interactions", xtb_control%do_nonbonded
2270 SELECT CASE (xtb_control%vdw_type)
2272 WRITE (unit=output_unit, fmt=
"(T2,A)")
"xTB| No vdW potential selected"
2274 WRITE (unit=output_unit, fmt=
"(T2,A,T72,A)")
"xTB| vdW potential type:",
"DFTD3(BJ)"
2275 WRITE (unit=output_unit, fmt=
"(T2,A,T31,A50)") &
2276 "xTB| D3 Dispersion: Parameter file", adjustr(trim(xtb_control%dispersion_parameter_file))
2278 WRITE (unit=output_unit, fmt=
"(T2,A,T76,A)")
"xTB| vdW potential type:",
"DFTD4"
2279 WRITE (unit=output_unit, fmt=
"(T2,A,T31,A50)") &
2280 "xTB| D4 Dispersion: Parameter file", adjustr(trim(xtb_control%dispersion_parameter_file))
2284 WRITE (unit=output_unit, fmt=
"(T2,A,T51,3F10.3)") &
2285 "xTB| Huckel constants ks kp kd", xtb_control%ks, xtb_control%kp, xtb_control%kd
2286 WRITE (unit=output_unit, fmt=
"(T2,A,T61,2F10.3)") &
2287 "xTB| Huckel constants ksp k2sh", xtb_control%ksp, xtb_control%k2sh
2288 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2289 "xTB| Mataga-Nishimoto exponent", xtb_control%kg
2290 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2291 "xTB| Repulsion potential exponent", xtb_control%kf
2292 WRITE (unit=output_unit, fmt=
"(T2,A,T51,3F10.3)") &
2293 "xTB| Coordination number scaling kcn(s) kcn(p) kcn(d)", &
2294 xtb_control%kcns, xtb_control%kcnp, xtb_control%kcnd
2295 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.3)") &
2296 "xTB| Electronegativity scaling", xtb_control%ken
2297 WRITE (unit=output_unit, fmt=
"(T2,A,T61,2F10.3)") &
2298 "xTB| Halogen potential scaling kxr kx2", xtb_control%kxr, xtb_control%kx2
2299 WRITE (unit=output_unit, fmt=
"(/)")
2304 "PRINT%DFT_CONTROL_PARAMETERS")
2306 CALL timestop(handle)
2308 END SUBROUTINE write_xtb_control
2319 CHARACTER(len=*),
PARAMETER :: routinen =
'write_qs_control'
2321 CHARACTER(len=20) :: method, quadrature
2322 INTEGER :: handle, i, igrid_level, ngrid_level, &
2331 IF (qs_control%semi_empirical)
RETURN
2332 IF (qs_control%dftb)
RETURN
2333 IF (qs_control%xtb)
RETURN
2334 CALL timeset(routinen, handle)
2335 NULLIFY (logger, print_section_vals, qs_section, qs_section_vals)
2341 NULLIFY (enum, keyword)
2344 method =
enum_i2c(enum, qs_control%method_id)
2346 NULLIFY (enum, keyword)
2349 quadrature =
enum_i2c(enum, qs_control%gapw_control%quadrature)
2352 "DFT_CONTROL_PARAMETERS", extension=
".Log")
2353 IF (output_unit > 0)
THEN
2354 ngrid_level =
SIZE(qs_control%e_cutoff)
2355 WRITE (unit=output_unit, fmt=
"(/,T2,A,T61,A20)") &
2356 "QS| Method:", adjustr(method)
2357 IF (qs_control%pw_grid_opt%spherical)
THEN
2358 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A)") &
2359 "QS| Density plane wave grid type",
" SPHERICAL HALFSPACE"
2360 ELSE IF (qs_control%pw_grid_opt%fullspace)
THEN
2361 WRITE (unit=output_unit, fmt=
"(T2,A,T57,A)") &
2362 "QS| Density plane wave grid type",
" NON-SPHERICAL FULLSPACE"
2364 WRITE (unit=output_unit, fmt=
"(T2,A,T57,A)") &
2365 "QS| Density plane wave grid type",
" NON-SPHERICAL HALFSPACE"
2367 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2368 "QS| Number of grid levels:",
SIZE(qs_control%e_cutoff)
2369 IF (ngrid_level == 1)
THEN
2370 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2371 "QS| Density cutoff [a.u.]:", qs_control%e_cutoff(1)
2373 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2374 "QS| Density cutoff [a.u.]:", qs_control%cutoff
2375 IF (qs_control%commensurate_mgrids) &
2376 WRITE (unit=output_unit, fmt=
"(T2,A)")
"QS| Using commensurate multigrids"
2377 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2378 "QS| Multi grid cutoff [a.u.]: 1) grid level", qs_control%e_cutoff(1)
2379 WRITE (unit=output_unit, fmt=
"(T2,A,I3,A,T71,F10.1)") &
2380 (
"QS| ", igrid_level,
") grid level", &
2381 qs_control%e_cutoff(igrid_level), &
2382 igrid_level=2,
SIZE(qs_control%e_cutoff))
2384 IF (qs_control%pao)
THEN
2385 WRITE (unit=output_unit, fmt=
"(T2,A)")
"QS| PAO active"
2387 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2388 "QS| Grid level progression factor:", qs_control%progression_factor
2389 WRITE (unit=output_unit, fmt=
"(T2,A,T71,F10.1)") &
2390 "QS| Relative density cutoff [a.u.]:", qs_control%relative_cutoff
2391 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2392 "QS| Interaction thresholds: eps_pgf_orb:", &
2393 qs_control%eps_pgf_orb, &
2394 "QS| eps_filter_matrix:", &
2395 qs_control%eps_filter_matrix, &
2396 "QS| eps_core_charge:", &
2397 qs_control%eps_core_charge, &
2398 "QS| eps_rho_gspace:", &
2399 qs_control%eps_rho_gspace, &
2400 "QS| eps_rho_rspace:", &
2401 qs_control%eps_rho_rspace, &
2402 "QS| eps_gvg_rspace:", &
2403 qs_control%eps_gvg_rspace, &
2405 qs_control%eps_ppl, &
2408 IF (qs_control%gapw)
THEN
2409 SELECT CASE (qs_control%gapw_control%basis_1c)
2411 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2412 "QS| GAPW| One center basis from orbital basis primitives"
2414 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2415 "QS| GAPW| One center basis extended with primitives (small:s)"
2417 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2418 "QS| GAPW| One center basis extended with primitives (medium:sp)"
2420 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2421 "QS| GAPW| One center basis extended with primitives (large:spd)"
2423 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2424 "QS| GAPW| One center basis extended with primitives (very large:spdf)"
2426 cpabort(
"basis_1c incorrect")
2428 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2429 "QS| GAPW| eps_fit:", &
2430 qs_control%gapw_control%eps_fit, &
2431 "QS| GAPW| eps_iso:", &
2432 qs_control%gapw_control%eps_iso, &
2433 "QS| GAPW| eps_svd:", &
2434 qs_control%gapw_control%eps_svd, &
2435 "QS| GAPW| eps_cpc:", &
2436 qs_control%gapw_control%eps_cpc
2437 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2438 "QS| GAPW| atom-r-grid: quadrature:", &
2440 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2441 "QS| GAPW| atom-s-grid: max l :", &
2442 qs_control%gapw_control%lmax_sphere, &
2443 "QS| GAPW| max_l_rho0 :", &
2444 qs_control%gapw_control%lmax_rho0
2445 IF (qs_control%gapw_control%non_paw_atoms)
THEN
2446 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2447 "QS| GAPW| At least one kind is NOT PAW, i.e. it has only soft AO "
2449 IF (qs_control%gapw_control%nopaw_as_gpw)
THEN
2450 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2451 "QS| GAPW| The NOT PAW atoms are treated fully GPW"
2454 IF (qs_control%gapw_xc)
THEN
2455 SELECT CASE (qs_control%gapw_control%basis_1c)
2457 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2458 "QS| GAPW_XC| One center basis from orbital basis primitives"
2460 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2461 "QS| GAPW_XC| One center basis extended with primitives (small:s)"
2463 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2464 "QS| GAPW_XC| One center basis extended with primitives (medium:sp)"
2466 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2467 "QS| GAPW_XC| One center basis extended with primitives (large:spd)"
2469 WRITE (unit=output_unit, fmt=
"(T2,A)") &
2470 "QS| GAPW_XC| One center basis extended with primitives (very large:spdf)"
2472 cpabort(
"basis_1c incorrect")
2474 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2475 "QS| GAPW_XC| eps_fit:", &
2476 qs_control%gapw_control%eps_fit, &
2477 "QS| GAPW_XC| eps_iso:", &
2478 qs_control%gapw_control%eps_iso, &
2479 "QS| GAPW_XC| eps_svd:", &
2480 qs_control%gapw_control%eps_svd
2481 WRITE (unit=output_unit, fmt=
"(T2,A,T55,A30)") &
2482 "QS| GAPW_XC|atom-r-grid: quadrature:", &
2483 enum_i2c(enum, qs_control%gapw_control%quadrature)
2484 WRITE (unit=output_unit, fmt=
"(T2,A,T71,I10)") &
2485 "QS| GAPW_XC| atom-s-grid: max l :", &
2486 qs_control%gapw_control%lmax_sphere
2488 IF (qs_control%mulliken_restraint)
THEN
2489 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2490 "QS| Mulliken restraint target", qs_control%mulliken_restraint_control%target
2491 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2492 "QS| Mulliken restraint strength", qs_control%mulliken_restraint_control%strength
2493 WRITE (unit=output_unit, fmt=
"(T2,A,T73,I8)") &
2494 "QS| Mulliken restraint atoms: ", qs_control%mulliken_restraint_control%natoms
2495 WRITE (unit=output_unit, fmt=
"(5I8)") qs_control%mulliken_restraint_control%atoms
2497 IF (qs_control%ddapc_restraint)
THEN
2498 DO i = 1,
SIZE(qs_control%ddapc_restraint_control)
2499 ddapc_restraint_control => qs_control%ddapc_restraint_control(i)
2500 IF (
SIZE(qs_control%ddapc_restraint_control) .GT. 1) &
2501 WRITE (unit=output_unit, fmt=
"(T2,A,T3,I8)") &
2502 "QS| parameters for DDAPC restraint number", i
2503 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2504 "QS| ddapc restraint target", ddapc_restraint_control%target
2505 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2506 "QS| ddapc restraint strength", ddapc_restraint_control%strength
2507 WRITE (unit=output_unit, fmt=
"(T2,A,T73,I8)") &
2508 "QS| ddapc restraint atoms: ", ddapc_restraint_control%natoms
2509 WRITE (unit=output_unit, fmt=
"(5I8)") ddapc_restraint_control%atoms
2510 WRITE (unit=output_unit, fmt=
"(T2,A)")
"Coefficients:"
2511 WRITE (unit=output_unit, fmt=
"(5F6.2)") ddapc_restraint_control%coeff
2512 SELECT CASE (ddapc_restraint_control%functional_form)
2514 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2515 "QS| ddapc restraint functional form :",
"RESTRAINT"
2517 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2518 "QS| ddapc restraint functional form :",
"CONSTRAINT"
2520 cpabort(
"Unknown ddapc restraint")
2524 IF (qs_control%s2_restraint)
THEN
2525 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2526 "QS| s2 restraint target", qs_control%s2_restraint_control%target
2527 WRITE (unit=output_unit, fmt=
"(T2,A,T73,ES8.1)") &
2528 "QS| s2 restraint strength", qs_control%s2_restraint_control%strength
2529 SELECT CASE (qs_control%s2_restraint_control%functional_form)
2531 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2532 "QS| s2 restraint functional form :",
"RESTRAINT"
2533 cpabort(
"Not yet implemented")
2535 WRITE (unit=output_unit, fmt=
"(T2,A,T61,A20)") &
2536 "QS| s2 restraint functional form :",
"CONSTRAINT"
2538 cpabort(
"Unknown ddapc restraint")
2543 "DFT_CONTROL_PARAMETERS")
2545 CALL timestop(handle)
2563 TYPE(
section_vals_type),
OPTIONAL,
POINTER :: qs_section, ddapc_restraint_section
2565 INTEGER :: i, j, jj, k, n_rep
2566 INTEGER,
DIMENSION(:),
POINTER :: tmplist
2567 REAL(kind=
dp),
DIMENSION(:),
POINTER :: rtmplist
2571 IF (
PRESENT(ddapc_restraint_section))
THEN
2572 IF (
ASSOCIATED(qs_control%ddapc_restraint_control))
THEN
2573 IF (
SIZE(qs_control%ddapc_restraint_control) .GE. 2) &
2574 cpabort(
"ET_COUPLING cannot be used in combination with a normal restraint")
2576 ddapc_section => ddapc_restraint_section
2577 ALLOCATE (qs_control%ddapc_restraint_control(1))
2581 IF (
PRESENT(qs_section))
THEN
2582 NULLIFY (ddapc_section)
2587 DO i = 1,
SIZE(qs_control%ddapc_restraint_control)
2590 ddapc_restraint_control => qs_control%ddapc_restraint_control(i)
2593 r_val=ddapc_restraint_control%strength)
2595 r_val=ddapc_restraint_control%target)
2597 i_val=ddapc_restraint_control%functional_form)
2601 i_val=ddapc_restraint_control%density_type)
2606 i_rep_val=k, i_vals=tmplist)
2607 DO j = 1,
SIZE(tmplist)
2611 IF (jj < 1) cpabort(
"Need at least 1 atom to use ddapc constraints")
2612 ddapc_restraint_control%natoms = jj
2613 IF (
ASSOCIATED(ddapc_restraint_control%atoms)) &
2614 DEALLOCATE (ddapc_restraint_control%atoms)
2615 ALLOCATE (ddapc_restraint_control%atoms(ddapc_restraint_control%natoms))
2619 i_rep_val=k, i_vals=tmplist)
2620 DO j = 1,
SIZE(tmplist)
2622 ddapc_restraint_control%atoms(jj) = tmplist(j)
2626 IF (
ASSOCIATED(ddapc_restraint_control%coeff)) &
2627 DEALLOCATE (ddapc_restraint_control%coeff)
2628 ALLOCATE (ddapc_restraint_control%coeff(ddapc_restraint_control%natoms))
2629 ddapc_restraint_control%coeff = 1.0_dp
2636 i_rep_val=k, r_vals=rtmplist)
2637 DO j = 1,
SIZE(rtmplist)
2639 IF (jj > ddapc_restraint_control%natoms) &
2640 cpabort(
"Need the same number of coeff as there are atoms ")
2641 ddapc_restraint_control%coeff(jj) = rtmplist(j)
2644 IF (jj < ddapc_restraint_control%natoms .AND. jj .NE. 0) &
2645 cpabort(
"Need no or the same number of coeff as there are atoms.")
2648 DO i = 1,
SIZE(qs_control%ddapc_restraint_control)
2649 IF (qs_control%ddapc_restraint_control(i)%functional_form == &
2652 IF (k == 2)
CALL cp_abort(__location__, &
2653 "Only a single constraint possible yet, try to use restraints instead ")
2662 SUBROUTINE read_efield_sections(dft_control, efield_section)
2666 CHARACTER(len=default_path_length) :: file_name
2667 INTEGER :: i, io, j, n, unit_nr
2668 REAL(kind=
dp),
DIMENSION(:),
POINTER :: tmp_vals
2672 DO i = 1,
SIZE(dft_control%efield_fields)
2673 NULLIFY (dft_control%efield_fields(i)%efield)
2674 ALLOCATE (dft_control%efield_fields(i)%efield)
2675 efield => dft_control%efield_fields(i)%efield
2676 NULLIFY (efield%envelop_i_vars, efield%envelop_r_vars)
2678 r_val=efield%strength)
2682 ALLOCATE (efield%polarisation(
SIZE(tmp_vals)))
2683 efield%polarisation = tmp_vals
2685 r_val=efield%phase_offset)
2687 i_val=efield%envelop_id)
2689 r_val=efield%wavelength)
2692 efield%vec_pot_initial = tmp_vals
2695 ALLOCATE (efield%envelop_i_vars(2))
2698 i_val=efield%envelop_i_vars(1))
2700 i_val=efield%envelop_i_vars(2))
2702 ALLOCATE (efield%envelop_r_vars(2))
2705 r_val=efield%envelop_r_vars(1))
2707 r_val=efield%envelop_r_vars(2))
2708 ELSE IF (efield%envelop_id ==
ramp_env)
THEN
2709 ALLOCATE (efield%envelop_i_vars(4))
2712 i_val=efield%envelop_i_vars(1))
2714 i_val=efield%envelop_i_vars(2))
2716 i_val=efield%envelop_i_vars(3))
2718 i_val=efield%envelop_i_vars(4))
2719 ELSE IF (efield%envelop_id ==
custom_env)
THEN
2722 CALL open_file(file_name=trim(file_name), file_action=
"READ", file_status=
"OLD", unit_number=unit_nr)
2726 READ (unit_nr, *, iostat=io)
2731 ALLOCATE (efield%envelop_r_vars(n + 1))
2736 READ (unit_nr, *) efield%envelop_r_vars(j)
2737 efield%envelop_r_vars(j) =
cp_unit_to_cp2k(efield%envelop_r_vars(j),
"volt/m")
2742 END SUBROUTINE read_efield_sections
2750 SUBROUTINE read_rtp_section(dft_control, rtp_section)
2755 INTEGER,
DIMENSION(:),
POINTER :: tmp
2756 LOGICAL :: is_present
2759 ALLOCATE (dft_control%rtp_control)
2761 i_val=dft_control%rtp_control%max_iter)
2763 i_val=dft_control%rtp_control%mat_exp)
2765 i_val=dft_control%rtp_control%aspc_order)
2767 r_val=dft_control%rtp_control%eps_exp)
2769 i_val=dft_control%rtp_control%rtp_method)
2771 i_val=dft_control%rtp_control%rtbse_ham)
2773 i_val=dft_control%rtp_control%propagator)
2775 r_val=dft_control%rtp_control%eps_ener)
2777 i_val=dft_control%rtp_control%initial_wfn)
2779 l_val=dft_control%rtp_control%hfx_redistribute)
2781 l_val=dft_control%rtp_control%apply_wfn_mix_init_restart)
2783 l_val=dft_control%rtp_control%apply_delta_pulse)
2785 l_val=dft_control%rtp_control%apply_delta_pulse_mag)
2787 l_val=dft_control%rtp_control%velocity_gauge)
2789 l_val=dft_control%rtp_control%nl_gauge_transform)
2791 l_val=dft_control%rtp_control%periodic)
2793 l_val=dft_control%rtp_control%linear_scaling)
2795 i_val=dft_control%rtp_control%mcweeny_max_iter)
2797 i_val=dft_control%rtp_control%acc_ref)
2799 r_val=dft_control%rtp_control%mcweeny_eps)
2801 r_val=dft_control%rtp_control%delta_pulse_scale)
2804 dft_control%rtp_control%delta_pulse_direction = tmp
2806 i_val=dft_control%rtp_control%sc_check_start)
2809 IF (is_present)
THEN
2810 IF (dft_control%rtp_control%linear_scaling) &
2811 CALL cp_abort(__location__, &
2812 "You have defined a time dependent projection of mos, but "// &
2813 "only the density matrix is propagated (DENSITY_PROPAGATION "// &
2814 ".TRUE.). Please either use MO-based real time DFT or do not "// &
2815 "define any PRINT%PROJECTION_MO section")
2816 dft_control%rtp_control%is_proj_mo = .true.
2818 dft_control%rtp_control%is_proj_mo = .false.
2821 END SUBROUTINE read_rtp_section
2828 SUBROUTINE read_admm_block_list(admm_control, dft_section)
2832 INTEGER :: irep, list_size, n_rep
2833 INTEGER,
DIMENSION(:),
POINTER :: tmplist
2840 ALLOCATE (admm_control%blocks(n_rep))
2844 i_rep_val=irep, i_vals=tmplist)
2845 list_size =
SIZE(tmplist)
2846 ALLOCATE (admm_control%blocks(irep)%list(list_size))
2847 admm_control%blocks(irep)%list(:) = tmplist(:)
2850 END SUBROUTINE read_admm_block_list
2859 SUBROUTINE read_hairy_probes_sections(dft_control, hairy_probes_section)
2863 INTEGER :: i, j, jj, kk, n_rep
2864 INTEGER,
DIMENSION(:),
POINTER :: tmplist
2866 DO i = 1,
SIZE(dft_control%probe)
2867 NULLIFY (dft_control%probe(i)%atom_ids)
2872 CALL section_vals_val_get(hairy_probes_section,
"ATOM_IDS", i_rep_section=i, i_rep_val=kk, i_vals=tmplist)
2873 jj = jj +
SIZE(tmplist)
2876 dft_control%probe(i)%natoms = jj
2877 IF (dft_control%probe(i)%natoms < 1) &
2878 cpabort(
"Need at least 1 atom to use hair probes formalism")
2879 ALLOCATE (dft_control%probe(i)%atom_ids(dft_control%probe(i)%natoms))
2883 CALL section_vals_val_get(hairy_probes_section,
"ATOM_IDS", i_rep_section=i, i_rep_val=kk, i_vals=tmplist)
2884 DO j = 1,
SIZE(tmplist)
2886 dft_control%probe(i)%atom_ids(jj) = tmplist(j)
2890 CALL section_vals_val_get(hairy_probes_section,
"MU", i_rep_section=i, r_val=dft_control%probe(i)%mu)
2892 CALL section_vals_val_get(hairy_probes_section,
"T", i_rep_section=i, r_val=dft_control%probe(i)%T)
2894 CALL section_vals_val_get(hairy_probes_section,
"ALPHA", i_rep_section=i, r_val=dft_control%probe(i)%alpha)
2896 CALL section_vals_val_get(hairy_probes_section,
"eps_hp", i_rep_section=i, r_val=dft_control%probe(i)%eps_hp)
2899 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_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.
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...