Line data Source code
1 : !--------------------------------------------------------------------------------------------------! 2 : ! CP2K: A general program to perform molecular dynamics simulations ! 3 : ! Copyright 2000-2024 CP2K developers group <https://cp2k.org> ! 4 : ! ! 5 : ! SPDX-License-Identifier: GPL-2.0-or-later ! 6 : !--------------------------------------------------------------------------------------------------! 7 : 8 : ! ************************************************************************************************** 9 : !> \brief Utility routines for qs_scf 10 : ! ************************************************************************************************** 11 : MODULE qs_scf_post_scf 12 : USE basis_set_output, ONLY: print_basis_set_file 13 : USE cp_control_types, ONLY: dft_control_type 14 : USE input_section_types, ONLY: section_vals_get,& 15 : section_vals_get_subs_vals,& 16 : section_vals_type 17 : USE localization_tb, ONLY: wfn_localization_tb 18 : USE lri_optimize_ri_basis, ONLY: optimize_lri_basis 19 : USE qs_band_structure, ONLY: calculate_band_structure 20 : USE qs_environment_types, ONLY: get_qs_env,& 21 : qs_environment_type 22 : USE qs_scf_post_gpw, ONLY: scf_post_calculation_gpw 23 : USE qs_scf_post_se, ONLY: scf_post_calculation_se 24 : USE qs_scf_post_tb, ONLY: scf_post_calculation_tb 25 : USE qs_scf_types, ONLY: qs_scf_env_type 26 : #include "./base/base_uses.f90" 27 : 28 : IMPLICIT NONE 29 : 30 : PRIVATE 31 : 32 : CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'qs_scf_post_scf' 33 : 34 : PUBLIC:: qs_scf_compute_properties 35 : 36 : CONTAINS 37 : 38 : ! ************************************************************************************************** 39 : !> \brief computes properties for a given hamilonian using the current wfn 40 : !> \param qs_env ... 41 : !> \param wf_type ... 42 : !> \param do_mp2 ... 43 : ! ************************************************************************************************** 44 38702 : SUBROUTINE qs_scf_compute_properties(qs_env, wf_type, do_mp2) 45 : TYPE(qs_environment_type), POINTER :: qs_env 46 : CHARACTER(6), OPTIONAL :: wf_type 47 : LOGICAL, OPTIONAL :: do_mp2 48 : 49 : LOGICAL :: explicit 50 : TYPE(dft_control_type), POINTER :: dft_control 51 : TYPE(qs_scf_env_type), POINTER :: scf_env 52 : TYPE(section_vals_type), POINTER :: dft_section, print_section 53 : 54 19351 : CALL get_qs_env(qs_env, scf_env=scf_env, dft_control=dft_control) 55 : 56 19351 : IF (dft_control%qs_control%semi_empirical) THEN 57 3680 : CALL scf_post_calculation_se(qs_env) 58 15671 : ELSEIF (dft_control%qs_control%dftb) THEN 59 1934 : CALL wfn_localization_tb(qs_env, "DFTB") 60 1934 : CALL scf_post_calculation_tb(qs_env, "DFTB", .FALSE.) 61 13737 : ELSEIF (dft_control%qs_control%xtb) THEN 62 4016 : CALL wfn_localization_tb(qs_env, "xTB") 63 4016 : CALL scf_post_calculation_tb(qs_env, "xTB", .FALSE.) 64 9721 : ELSEIF (dft_control%qs_control%do_kg) THEN 65 18 : CPWARN("No properties from PRINT section available for KG methods") 66 9703 : ELSEIF (dft_control%qs_control%ofgpw) THEN 67 0 : CPWARN("No properties from PRINT section available for OFGPW methods") 68 9703 : ELSEIF (dft_control%qs_control%lri_optbas .AND. dft_control%qs_control%gpw) THEN 69 6 : CALL optimize_lri_basis(qs_env) 70 : ELSE 71 9697 : IF (PRESENT(wf_type)) THEN 72 314 : IF (PRESENT(do_mp2)) THEN 73 314 : CALL scf_post_calculation_gpw(qs_env, wf_type=wf_type, do_mp2=do_mp2) 74 : ELSE 75 0 : CALL scf_post_calculation_gpw(qs_env, wf_type=wf_type) 76 : END IF 77 : ELSE 78 9383 : CALL scf_post_calculation_gpw(qs_env) 79 : END IF 80 : END IF 81 : 82 19351 : CALL calculate_band_structure(qs_env) 83 : 84 19351 : dft_section => section_vals_get_subs_vals(qs_env%input, "DFT") 85 19351 : print_section => section_vals_get_subs_vals(dft_section, "PRINT%BASIS_SET_FILE") 86 19351 : CALL section_vals_get(print_section, explicit=explicit) 87 19351 : IF (explicit) THEN 88 2 : CALL print_basis_set_file(qs_env, print_section) 89 : END IF 90 : 91 19351 : END SUBROUTINE qs_scf_compute_properties 92 : 93 : END MODULE qs_scf_post_scf