(git:cd590b0)
Loading...
Searching...
No Matches
bse_input.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief Reads the &BSE input section into the BSE environment; called by read_mp2_section with
10!> the section under RI_RPA%GW, by any other GW path with its own section, and again by
11!> prepare_bse_env before every BSE run
12!> \par History
13!> 09.2026 moved out of read_mp2_section [Maximilian Graml]
14! **************************************************************************************************
16 USE bse_types, ONLY: bse_env_type
20#include "./base/base_uses.f90"
21
22 IMPLICIT NONE
23
24 PRIVATE
25
26 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'bse_input'
27
28 PUBLIC :: read_bse_section
29
30CONTAINS
31
32! **************************************************************************************************
33!> \brief Reads every keyword of the &BSE section into the settings of the BSE environment
34!> \param bse_section the &BSE section of the calling GW path
35!> \param bse_env receives every keyword and keeps the section pointer for the NTO print keys
36! **************************************************************************************************
37 SUBROUTINE read_bse_section(bse_section, bse_env)
38 TYPE(section_vals_type), POINTER :: bse_section
39 TYPE(bse_env_type), INTENT(INOUT) :: bse_env
40
41 INTEGER :: print_level_nto_analysis
42
43 bse_env%bse_section => bse_section
44 CALL section_vals_val_get(bse_section, "_SECTION_PARAMETERS_", &
45 l_val=bse_env%do_bse)
46 CALL section_vals_val_get(bse_section, "SPIN_CONFIG", &
47 i_val=bse_env%bse_spin_config)
48 CALL section_vals_val_get(bse_section, "ENERGY_CUTOFF_OCC", &
49 r_val=bse_env%bse_cutoff_occ)
50 CALL section_vals_val_get(bse_section, "ENERGY_CUTOFF_EMPTY", &
51 r_val=bse_env%bse_cutoff_empty)
52 CALL section_vals_val_get(bse_section, "NUM_PRINT_EXC", &
53 i_val=bse_env%num_print_exc)
54 CALL section_vals_val_get(bse_section, "NUM_PRINT_EXC_DESCR", &
55 i_val=bse_env%num_print_exc_descr)
56 CALL section_vals_val_get(bse_section, "PRINT_DIRECTIONAL_EXC_DESCR", &
57 l_val=bse_env%print_directional_exc_descr)
58 CALL section_vals_val_get(bse_section, "PRINT_DIRECTIONAL_CROSSCORRELATION", &
59 l_val=bse_env%print_directional_crosscorrelation)
60 CALL section_vals_val_get(bse_section, "EPS_X", &
61 r_val=bse_env%eps_x)
62 CALL section_vals_val_get(bse_section, "BSE_ITERAT%NUM_EXC_EN", &
63 i_val=bse_env%num_exc_en)
64 CALL section_vals_val_get(bse_section, "BSE_ITERAT%NUM_BUFFER_STATES", &
65 i_val=bse_env%num_buffer_states)
66 CALL section_vals_val_get(bse_section, "BSE_ITERAT%BLOCK_SIZE", &
67 i_val=bse_env%block_size)
68 CALL section_vals_val_get(bse_section, "BSE_ITERAT%NUM_GUESS_TRANSITIONS", &
69 i_val=bse_env%num_guess_transitions)
70 CALL section_vals_val_get(bse_section, "BSE_ITERAT%MAX_SUBSPACE_FACTOR", &
71 i_val=bse_env%max_subspace_factor)
72 CALL section_vals_val_get(bse_section, "BSE_ITERAT%MATVEC_BLOCK_COLUMNS", &
73 i_val=bse_env%matvec_block_columns)
74 CALL section_vals_val_get(bse_section, "BSE_ITERAT%MEMORY_CHECK", &
75 i_val=bse_env%memory_check)
76 CALL section_vals_val_get(bse_section, "BSE_ITERAT%MEMORY_BUDGET_GB", &
77 r_val=bse_env%memory_budget_gb)
78 CALL section_vals_val_get(bse_section, "BSE_ITERAT%MAX_ITER", &
79 i_val=bse_env%max_iter)
80 CALL section_vals_val_get(bse_section, "BSE_ITERAT%CONVERGENCE_CRITERION", &
81 i_val=bse_env%convergence_criterion)
82 CALL section_vals_val_get(bse_section, "BSE_ITERAT%EPS_RES", &
83 r_val=bse_env%eps_res)
84 CALL section_vals_val_get(bse_section, "BSE_ITERAT%EPS_ENERGY", &
85 r_val=bse_env%eps_energy)
86 CALL section_vals_val_get(bse_section, "BSE_ITERAT%PRECONDITIONER", &
87 i_val=bse_env%preconditioner)
88 CALL section_vals_val_get(bse_section, "BSE_ITERAT%ABBA_SOLVER", &
89 i_val=bse_env%abba_solver)
90 CALL section_vals_val_get(bse_section, "BSE_DIAG_METHOD", &
91 i_val=bse_env%bse_diag_method)
92 CALL section_vals_val_get(bse_section, "TDA", &
93 i_val=bse_env%flag_tda)
94 CALL section_vals_val_get(bse_section, "USE_KS_ENERGIES", &
95 l_val=bse_env%use_ks_energies)
96 CALL section_vals_val_get(bse_section, "SCREENING_IN_W%_SECTION_PARAMETERS_", &
97 i_val=bse_env%screening_method)
98 CALL section_vals_val_get(bse_section, "SCREENING_IN_W%ALPHA", &
99 r_val=bse_env%screening_factor)
100 CALL section_vals_val_get(bse_section, "BSE_DEBUG_PRINT", &
101 l_val=bse_env%bse_debug_print)
102 CALL section_vals_val_get(bse_section, "BSE_SPECTRUM%_SECTION_PARAMETERS_", &
103 l_val=bse_env%bse_print_spectrum)
104 CALL section_vals_val_get(bse_section, "BSE_SPECTRUM%FREQUENCY_STEP_SIZE", &
105 r_val=bse_env%bse_spectrum_freq_step_size)
106 CALL section_vals_val_get(bse_section, "BSE_SPECTRUM%FREQUENCY_STARTING_POINT", &
107 r_val=bse_env%bse_spectrum_freq_start)
108 CALL section_vals_val_get(bse_section, "BSE_SPECTRUM%FREQUENCY_END_POINT", &
109 r_val=bse_env%bse_spectrum_freq_end)
110 CALL section_vals_val_get(bse_section, "BSE_SPECTRUM%ETA_LIST", &
111 r_vals=bse_env%bse_eta_spectrum_list)
112 CALL section_vals_val_get(bse_section, "NTO_ANALYSIS%_SECTION_PARAMETERS_", &
113 i_val=print_level_nto_analysis)
114 ! a print key read as a switch: every value but OFF runs the analysis, whatever GLOBAL%PRINT_LEVEL;
115 ! cp_print_key_section_create encodes OFF as debug_print_level + 1
116 bse_env%do_nto_analysis = (print_level_nto_analysis /= debug_print_level + 1)
117 CALL section_vals_val_get(bse_section, "NTO_ANALYSIS%EPS_NTO_EIGVAL", &
118 r_val=bse_env%eps_nto_eigval)
119 CALL section_vals_val_get(bse_section, "NTO_ANALYSIS%EPS_OSC_STR", &
120 r_val=bse_env%eps_nto_osc_str)
121 CALL section_vals_val_get(bse_section, "NTO_ANALYSIS%NUM_PRINT_EXC_NTOS", &
122 i_val=bse_env%num_print_exc_ntos)
123 CALL section_vals_val_get(bse_section, "NTO_ANALYSIS%STATE_LIST", &
124 explicit=bse_env%explicit_nto_list)
125 IF (bse_env%explicit_nto_list) THEN
126 CALL section_vals_val_get(bse_section, "NTO_ANALYSIS%STATE_LIST", &
127 i_vals=bse_env%bse_nto_state_list)
128 END IF
129
130 END SUBROUTINE read_bse_section
131
132END MODULE bse_input
Reads the &BSE input section into the BSE environment; called by read_mp2_section with the section un...
Definition bse_input.F:15
subroutine, public read_bse_section(bse_section, bse_env)
Reads every keyword of the &BSE section into the settings of the BSE environment.
Definition bse_input.F:38
The BSE environment: the settings of the &BSE section and the state a GW path prepares for the solver...
Definition bse_types.F:14
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer, parameter, public debug_print_level
objects that represent the structure of input sections and the data contained in an input section
subroutine, public section_vals_val_get(section_vals, keyword_name, i_rep_section, i_rep_val, n_rep_val, val, l_val, i_val, r_val, c_val, l_vals, i_vals, r_vals, c_vals, explicit)
returns the requested value
Settings of the &BSE section (read_bse_section, re-read by prepare_bse_env, normalised in place by ad...
Definition bse_types.F:41