(git:f2099e5)
Loading...
Searching...
No Matches
input_cp2k_fde.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!--------------------------------------------------------------------------------------------------!
14 USE kinds, ONLY: dp
15#include "./base/base_uses.f90"
16
17 IMPLICIT NONE
18 PRIVATE
19
20 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'input_cp2k_fde'
21
22 PUBLIC :: create_fde_section
23
24CONTAINS
25
26! **************************************************************************************************
27!> \brief Create the FDE (frozen-density embedding) input section
28!> \param section ...
29! **************************************************************************************************
30 SUBROUTINE create_fde_section(section)
31 TYPE(section_type), POINTER :: section
32
33 TYPE(keyword_type), POINTER :: keyword
34
35 cpassert(.NOT. ASSOCIATED(section))
36 CALL section_create(section, __location__, name="FDE", &
37 description="Parameters for in-DFT frozen-density embedding (FDE). "// &
38 "CP2K drives a freeze-and-thaw optimization and spawns another "// &
39 "program to perform another calculation on the subsystem. The two "// &
40 "codes interact via the embedding potential and densities exchanged "// &
41 "on the real-space grid. The nonadditive kinetic-energy functional "// &
42 "is taken from the KG_METHOD section.", &
43 n_keywords=13, n_subsections=0, repeats=.false.)
44
45 NULLIFY (keyword)
46
47 CALL keyword_create(keyword, __location__, name="_SECTION_PARAMETERS_", &
48 description="Controls the activation of the FDE driver.", &
49 default_l_val=.false., lone_keyword_l_val=.true.)
50 CALL section_add_keyword(section, keyword)
51 CALL keyword_release(keyword)
52
53 CALL keyword_create(keyword, __location__, name="FREEZE_AND_THAW", &
54 description="Run the freeze-and-thaw loop, relaxing both the "// &
55 "environment and the subsystem alternately. If .FALSE., perform "// &
56 "a one-shot embedding of the subsystem in the fixed environment "// &
57 "density.", &
58 usage="FREEZE_AND_THAW T", default_l_val=.false., lone_keyword_l_val=.true.)
59 CALL section_add_keyword(section, keyword)
60 CALL keyword_release(keyword)
61
62 CALL keyword_create(keyword, __location__, name="MAX_FT_ITER", &
63 description="Maximum number of freeze-and-thaw iterations.", &
64 usage="MAX_FT_ITER 20", default_i_val=50)
65 CALL section_add_keyword(section, keyword)
66 CALL keyword_release(keyword)
67
68 CALL keyword_create(keyword, __location__, name="EPS_FT_DENSITY", &
69 description="Convergence threshold on the absolute change of the "// &
70 "density between freeze-and-thaw iterations.", &
71 usage="EPS_FT_DENSITY 1.0E-5", default_r_val=1.0e-5_dp)
72 CALL section_add_keyword(section, keyword)
73 CALL keyword_release(keyword)
74
75 CALL keyword_create(keyword, __location__, name="EPS_FT_ENERGY", &
76 description="Convergence threshold on the total energy change "// &
77 "between freeze-and-thaw iterations.", &
78 usage="EPS_FT_ENERGY 1.0E-6", default_r_val=1.0e-6_dp)
79 CALL section_add_keyword(section, keyword)
80 CALL keyword_release(keyword)
81
82 CALL keyword_create(keyword, __location__, name="DENSITY_MIXING", &
83 description="Linear mixing factor applied to the subsystem density "// &
84 "between macro-iterations. 1.0 = no damping.", &
85 usage="DENSITY_MIXING 0.5", default_r_val=1.0_dp)
86 CALL section_add_keyword(section, keyword)
87 CALL keyword_release(keyword)
88
89 CALL keyword_create(keyword, __location__, name="COMMAND", &
90 description="Shell command used to run the subsystem solver on the "// &
91 "generated input file. The input file name is passed as the last "// &
92 "argument.", &
93 usage="COMMAND pymolcas", default_c_val="pymolcas")
94 CALL section_add_keyword(section, keyword)
95 CALL keyword_release(keyword)
96
97 CALL keyword_create(keyword, __location__, name="PROJECT", &
98 description="Project name for the active-subsystem calculation.", &
99 usage="PROJECT sub", default_c_val="sub")
100 CALL section_add_keyword(section, keyword)
101 CALL keyword_release(keyword)
102
103 CALL keyword_create(keyword, __location__, name="WORKDIR", &
104 description="Working directory in which the subsystem calculation is "// &
105 "run and the exchange files are written. Defaults to the current "// &
106 "working directory.", &
107 usage="WORKDIR ./sub", default_c_val="")
108 CALL section_add_keyword(section, keyword)
109 CALL keyword_release(keyword)
110
111 CALL keyword_create(keyword, __location__, name="MOLCAS_INPUT_TEMPLATE", &
112 description="Path to the OpenMolcas input template for the subsystem "// &
113 "(GATEWAY/SEWARD/RASSCF). The driver appends the EMBEDDING block.", &
114 usage="MOLCAS_INPUT_TEMPLATE sub.template.inp", default_c_val="")
115 CALL section_add_keyword(section, keyword)
116 CALL keyword_release(keyword)
117
118 CALL keyword_create(keyword, __location__, name="POT_FILE", &
119 description="File name (in WORKDIR) for the embedding potential "// &
120 "written in OpenMolcas format.", &
121 usage="POT_FILE EMBPOT", default_c_val="EMBPOT")
122 CALL section_add_keyword(section, keyword)
123 CALL keyword_release(keyword)
124
125 CALL keyword_create(keyword, __location__, name="GRID_FILE", &
126 description="File name (in WORKDIR) for the output grid coordinates "// &
127 "on which the subsystem solver evaluates and returns the density.", &
128 usage="GRID_FILE EMBGRID", default_c_val="EMBGRID")
129 CALL section_add_keyword(section, keyword)
130 CALL keyword_release(keyword)
131
132 CALL keyword_create(keyword, __location__, name="RHO_FILE", &
133 description="File name (in WORKDIR) with the subsystem density "// &
134 "returned by the subsystem solver on the output grid.", &
135 usage="RHO_FILE EMBRHOA", default_c_val="EMBRHOA")
136 CALL section_add_keyword(section, keyword)
137 CALL keyword_release(keyword)
138
139 CALL keyword_create(keyword, __location__, name="RESULT_FILE", &
140 description="File name (in WORKDIR) with the scalar results returned "// &
141 "by the subsystem solver (embedded energy, Tr(D*v_emb), active "// &
142 "nuclear repulsion, number of active electrons).", &
143 usage="RESULT_FILE EMBRES", default_c_val="EMBRES")
144 CALL section_add_keyword(section, keyword)
145 CALL keyword_release(keyword)
146
147 END SUBROUTINE create_fde_section
148
149END MODULE input_cp2k_fde
subroutine, public create_fde_section(section)
Create the FDE (frozen-density embedding) input section.
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, deprecation_notice)
creates a list of keywords
subroutine, public section_add_keyword(section, keyword)
adds a keyword to the given section
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
represent a keyword in the input
represent a section of the input file