35#include "./base/base_uses.f90"
40 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'input_cp2k_external'
62 cpassert(.NOT.
ASSOCIATED(section))
65 description=
"Section controlling the presence of an electrostatic "// &
66 "external potential dependent on the atomic positions (X,Y,Z). "// &
67 "As the external potential is currently applied via a grid, "// &
68 "it only works with DFT based methods (GPW/GAPW) that already use "// &
69 "a grid-based approach to solve the Poisson equation. Not to be "// &
71 "* FORCE_EVAL/EXTERNAL_POTENTIAL, which is applicable to general "// &
72 "force methods and is not grid-based;"//
newline// &
73 "* FORCE_EVAL/DFT/EFIELD, which is for finite, time-dependent "// &
74 "electric field in DFT;"//
newline// &
75 "* FORCE_EVAL/DFT/PERIODIC_EFIELD, which is for finite periodic "// &
76 "electric field using the Berry phase approach in DFT.", &
77 do_deriv=.true., input_variables=[
"X",
"Y",
"Z"])
78 NULLIFY (keyword, subsection)
81 description=
"Specifies the external potential as STATIC or time dependent. At the moment "// &
82 "only static potentials are implemented.", &
83 usage=
"STATIC T", default_l_val=.true., lone_keyword_l_val=.true.)
88 CALL keyword_create(keyword, __location__, name=
"READ_FROM_CUBE", &
89 description=
"Switch for reading the external potential from file pot.cube. The values "// &
90 "of the potential must be on the grid points of the realspace grid. "// &
91 "Whitespace-separated cube values are accepted. If adjacent values are written "// &
92 "without whitespace, each value must occupy a 13-character E13.5 field.", &
93 usage=
"READ_FROM_CUBE T", default_l_val=.false., lone_keyword_l_val=.true.)
98 CALL keyword_create(keyword, __location__, name=
"SCALING_FACTOR", &
99 description=
"A factor for scaling the the external potential that is read from file. "// &
100 "The value of the potential at each grid point is multiplied by this factor.", &
101 usage=
"SCALING_FACTOR <REAL>", default_r_val=1.0_dp)
105 CALL create_maxwell_section(subsection)
117 SUBROUTINE create_maxwell_section(section)
122 cpassert(.NOT.
ASSOCIATED(section))
124 description=
"Section controlling the calculation of an electrostatic "// &
125 "external potential calculated from Maxwell equations. ", &
126 n_keywords=1, n_subsections=0, repeats=.false.)
130 description=
"Test for logical value", &
131 usage=
"TEST_LOGICAL T", default_l_val=.false., lone_keyword_l_val=.true.)
136 description=
"TEST for Real", &
137 usage=
"TEST_REAL <REAL>", default_r_val=1.0_dp)
142 description=
"TEST for Int", &
143 usage=
"TEST_INTEGER <INT>", default_i_val=0)
147 END SUBROUTINE create_maxwell_section
160 cpassert(.NOT.
ASSOCIATED(section))
161 CALL section_create(section, __location__, name=
"EXTERNAL_DENSITY", &
162 description=
"Section for the use of the ZMP technique on external densities.", &
163 n_keywords=4, n_subsections=0, repeats=.false., &
168 description=
"Specifies the filename containing the target density in *.cube format. "// &
169 "In the MGRID section it must be imposed NGRID 1, as it works with only "// &
170 "one grid. The number of points in each direction, and the spacing must "// &
171 "be previously defined choosing the plane waves cut-off in section MGRID "// &
172 "keyword CUTOFF, and the cube dimension in section SUBSYS / CELL / keyword ABC", &
173 usage=
"FILE_DENSITY <FILENAME>", &
174 type_of_var=
char_t, default_c_val=
"RHO_O.dat", n_var=-1)
179 description=
"Lagrange multiplier defined in the constraint ZMP method. When starting, use "// &
180 "small values when starting from scratch (around 5,10). Then gradually increase "// &
181 "the values depending, restarting from the previous calculation with the smaller "// &
182 "value. To choose the progressive values of LAMBDA look at the convergence of the "// &
184 usage=
"LAMBDA <REAL>", default_r_val=10.0_dp)
188 CALL keyword_create(keyword, __location__, name=
"ZMP_CONSTRAINT", &
189 description=
"Specify which kind of constraint to solve the ZMP equation. The COULOMB default "// &
190 "option is more stable.", &
191 usage=
"ZMP_CONSTRAINT <CHAR>", &
192 enum_c_vals=
s2a(
"COULOMB",
"DIFF",
"NONE"), &
194 enum_desc=
s2a(
"Coulomb constraint, integral of [rho_0(r)-rho(r)]/|r-r'|", &
195 "Simple constraint, [rho_0(r)-rho(r)]", &
196 "No constrain imposed"), &
202 description=
"Add the Fermi-Amaldi contribution to the Hartree potential. "// &
203 "It leads to a more stable convergence.", &
204 usage=
"FERMI_AMALDI <LOGICAL>", &
207 default_l_val=.true., lone_keyword_l_val=.true.)
224 cpassert(.NOT.
ASSOCIATED(section))
226 description=
"SCF convergence with external v_xc calculated through previous ZMP "// &
228 n_keywords=1, n_subsections=0, repeats=.false.)
232 description=
"The *.cube filename containing the v_xc potential. This works only "// &
233 "with NGRID 1 imposed in the MGRID section. The number of points in each "// &
234 "direction, and the spacing must equal to those previously used in the ZMP "// &
235 "calculation and defined through the plane wave cut-off and the cube dimension "// &
236 "respectively set in section MGRID / keyword CUTOFF, and in section SUBSYS / "// &
237 "CELL / keyword ABC", &
238 usage=
"FILE_VXC <FILENAME>", &
239 type_of_var=
char_t, default_c_val=
"VXC_O.dat", n_var=-1)
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public zhao1994
integer, save, public tozer1996
Defines the basic variable types.
integer, parameter, public dp
Utilities for string manipulations.
character(len=1), parameter, public newline