(git:b1f098b)
Loading...
Searching...
No Matches
input_cp2k_projection_rtp.F
Go to the documentation of this file.
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 function that builds the projection of MO in RTP section of the input
10!> \author Guillaume Le Breton 04.2023
11! **************************************************************************************************
24 USE input_val_types, ONLY: integer_t
25 USE string_utilities, ONLY: s2a
26#include "./base/base_uses.f90"
27
28 IMPLICIT NONE
29 PRIVATE
30
31 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_projection_rtp'
32
34
35CONTAINS
36
37! **************************************************************************************************
38!> \brief creates the section for time dependent projection of the MOs
39!> \param section ...
40!> \author Guillaume Le Breton
41! **************************************************************************************************
43 TYPE(section_type), POINTER :: section
44
45 TYPE(keyword_type), POINTER :: keyword
46 TYPE(section_type), POINTER :: subsection
47
48 cpassert(.NOT. ASSOCIATED(section))
49 CALL section_create(section, __location__, name="PROJECTION_MO", &
50 description="Projects the Time Dependent (TD) MO "// &
51 "coefficients to reference ones. You can define "// &
52 "several sections like this to project the TD-MOs "// &
53 "on different reference MOs. Note that each section "// &
54 "projects from one spin of the TD MOs (TD_MO_INDEX) to "// &
55 "one spin of the reference MOs (REF_MO_INDEX).", &
56 n_keywords=7, n_subsections=1, &
57 repeats=.true.)
58
59 NULLIFY (keyword, subsection)
60 CALL keyword_create(keyword, __location__, name="PROPAGATE_REF", &
61 description="In the case of Ehrenfest dynamics, the atomic basis set is evolving with time. "// &
62 "The reference MO can either be understood as a spatial-dependent wave-function which is "// &
63 "time-independent or to be 'attached' with respect to the nuclei position, and "// &
64 "thus evolve in space as the nuclei move. For the first case, set this variable to TRUE. "// &
65 "Note that in this case, you shall have enough atomic orbital across the whole space to "// &
66 "describe this MO as the nuclei will move and may leave the space where the MO is defined. "// &
67 "For the second case, set to FALSE (default). Note that in this case, if the nuclei undergo "// &
68 "dramatic changes (dissociation for instance) then this definition may make no longer sense.", &
69 usage="PROPAGATE_REF .TRUE.", &
70 default_l_val=.false., lone_keyword_l_val=.true., &
71 repeats=.false.)
72 CALL section_add_keyword(section, keyword)
73 CALL keyword_release(keyword)
74
75 CALL keyword_create(keyword, __location__, name="REFERENCE_TYPE", &
76 description="Type of the reference MO file provided in REF_MO_FILE_NAME.", &
77 enum_c_vals=s2a("SCF", "XAS_TDP"), &
78 usage="REFERENCE_TYPE SCF", &
79 default_i_val=proj_mo_ref_scf, &
80 enum_desc=s2a("The reference MO is from an SCF calculation.", &
81 "The reference MO is from an XAS_TDP analysis."), &
82 enum_i_vals=(/proj_mo_ref_scf, proj_mo_ref_xas_tdp/))
83 CALL section_add_keyword(section, keyword)
84 CALL keyword_release(keyword)
85
86 CALL keyword_create(keyword, __location__, name="REF_MO_FILE_NAME", &
87 description="Name of the wavefunction file to read the reference MO from. "// &
88 "For instance, a restart wfn file from SCF calculation or an excited state from XAS_TDP calculation. "// &
89 "If no file is specified, the default is to use DFT%WFN_RESTART_FILE_NAME. "// &
90 "Currently, a RTP restart file (.rtpwfn) cannot be used as reference. "// &
91 "Currently, this file SHALL have the same number of spin as the propagated one "// &
92 "(eventhough you use only the first spin from this reference).", &
93 usage="REF_MO_FILE_NAME <FILENAME>", &
94 default_lc_val="DEFAULT")
95 CALL section_add_keyword(section, keyword)
96 CALL keyword_release(keyword)
97
98 CALL keyword_create(keyword, __location__, name="REF_MO_INDEX", &
99 description="Indexes of the reference MO read from the .wfn reference file (see REF_MO_FILE_NAME). "// &
100 "Use this keyword if REFERENCE_TYPE=SCF. "// &
101 "Set to -1 to project on all the MO available. "// &
102 "One file will be generated per index defined.", &
103 usage="MO_REF_INDEX 1 2", &
104 default_i_vals=(/1/), &
105 n_var=-1, type_of_var=integer_t, repeats=.false.)
106 CALL section_add_keyword(section, keyword)
107 CALL keyword_release(keyword)
108
109 CALL keyword_create(keyword, __location__, name="REF_MO_SPIN", &
110 description="Spin of the reference MOs to consider. "// &
111 "1 for ALPHA and 2 for BETA spin respectively. "// &
112 "If the reference MO is spin independent this key is not used.", &
113 usage="REF_MO_SPIN 1", &
114 default_i_val=1, &
115 n_var=1, type_of_var=integer_t, repeats=.false.)
116
117 CALL section_add_keyword(section, keyword)
118 CALL keyword_release(keyword)
119
120 CALL keyword_create(keyword, __location__, name="REF_ADD_LUMO", &
121 description="If the reference MOs include more empty states that are not propagated, "// &
122 "using this keyword it is possible to read them as well and thus compute the corresponding projection. ", &
123 usage="REF_ADD_LUMO 10", &
124 default_i_val=0, &
125 n_var=1, type_of_var=integer_t, repeats=.false.)
126
127 CALL section_add_keyword(section, keyword)
128 CALL keyword_release(keyword)
129
130 CALL keyword_create(keyword, __location__, name="SUM_ON_ALL_REF", &
131 description="Set to .TRUE. in order to sum all the projections done "// &
132 "over the required MO_REF_INDEX for each TD MOs. "// &
133 "Only one file will be generated containing the results for every MO_TD_INDEX.", &
134 usage="SUM_ON_ALL_REF .TRUE.", &
135 default_l_val=.false., lone_keyword_l_val=.true., &
136 repeats=.false.)
137 CALL section_add_keyword(section, keyword)
138 CALL keyword_release(keyword)
139
140 CALL keyword_create(keyword, __location__, name="TD_MO_INDEX", &
141 description="Indexes of the time dependent MOs to project on the reference MOs. "// &
142 "Set to -1 to project on all the TD MOs.", &
143 usage="MO_TD_INDEX 1 2", &
144 default_i_vals=(/1/), &
145 n_var=-1, type_of_var=integer_t, repeats=.false.)
146 CALL section_add_keyword(section, keyword)
147 CALL keyword_release(keyword)
148
149 CALL keyword_create(keyword, __location__, name="TD_MO_SPIN", &
150 description="Spin of the TD MOs to consider. 1 for ALPHA spin, 2 for BETA spin. "// &
151 "If the TD calculation is spin independent this key is not used.", &
152 usage="MO_TD_SPIN 1", &
153 default_i_val=1, &
154 n_var=1, type_of_var=integer_t)
155 CALL section_add_keyword(section, keyword)
156 CALL keyword_release(keyword)
157
158 CALL keyword_create(keyword, __location__, name="SUM_ON_ALL_TD", &
159 description="Set to .TRUE. in order to sum the projection done over all on TD MOs on the required MO_REF_INDEX. "// &
160 "One file per MO_REF_INDEX will be generated. "// &
161 "Combining SUM_ON_ALL_TD and SUM_ON_ALL_REF lead to one file one projection: "// &
162 "the population of all the defined TD_MO_INDEX over the reference MO_REF_INDEX per time step required.", &
163 usage="SUM_ON_ALL_TD .TRUE.", &
164 default_l_val=.false., lone_keyword_l_val=.true., &
165 repeats=.false.)
166 CALL section_add_keyword(section, keyword)
167 CALL keyword_release(keyword)
168
169 ! The results for different time step are stored in the same file by default:
170 CALL cp_print_key_section_create(subsection, __location__, name="PRINT", &
171 description="How to print the MO projection", &
172 common_iter_levels=999999999, &
173 filename="PROJ_MO")
174 CALL section_add_subsection(section, subsection)
175 CALL section_release(subsection)
176
177 END SUBROUTINE create_projection_rtp_section
178
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
subroutine, public cp_print_key_section_create(print_key_section, location, name, description, print_level, each_iter_names, each_iter_values, add_last, filename, common_iter_levels, citations, unit_str)
creates a print_key section
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public proj_mo_ref_xas_tdp
integer, parameter, public proj_mo_ref_scf
function that builds the projection of MO in RTP section of the input
subroutine, public create_projection_rtp_section(section)
creates the section for time dependent projection of the MOs
represents keywords in an input
subroutine, public keyword_release(keyword)
releases the given keyword (see doc/ReferenceCounting.html)
subroutine, public keyword_create(keyword, location, name, description, usage, type_of_var, n_var, repeats, variants, default_val, default_l_val, default_r_val, default_lc_val, default_c_val, default_i_val, default_l_vals, default_r_vals, default_c_vals, default_i_vals, lone_keyword_val, lone_keyword_l_val, lone_keyword_r_val, lone_keyword_c_val, lone_keyword_i_val, lone_keyword_l_vals, lone_keyword_r_vals, lone_keyword_c_vals, lone_keyword_i_vals, enum_c_vals, enum_i_vals, enum, enum_strict, enum_desc, unit_str, citations, deprecation_notice, removed)
creates a keyword object
objects that represent the structure of input sections and the data contained in an input section
subroutine, public section_create(section, location, name, description, n_keywords, n_subsections, repeats, citations)
creates a list of keywords
subroutine, public section_add_keyword(section, keyword)
adds a keyword to the given section
subroutine, public section_add_subsection(section, subsection)
adds a subsection to the given section
recursive subroutine, public section_release(section)
releases the given keyword list (see doc/ReferenceCounting.html)
a wrapper for basic fortran types.
integer, parameter, public integer_t
Utilities for string manipulations.
represent a keyword in the input
represent a section of the input file