34#include "./base/base_uses.f90"
39 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'input_cp2k_external'
57 cpassert(.NOT.
ASSOCIATED(section))
58 CALL section_create(section, __location__, name=
"EXTERNAL_POTENTIAL", &
59 description=
"Section controlling the presence of an electrostatic "// &
60 "external potential dependent on the atomic positions (X,Y,Z). "// &
61 "As the external potential is currently applied via a grid, "// &
62 "it only works with DFT based methods (GPW/GAPW) that already use "// &
63 "a grid based approach to solve the Poisson equation.", &
64 n_keywords=7, n_subsections=0, repeats=.false.)
65 NULLIFY (keyword, subsection)
68 description=
"Specifies the functional form in mathematical notation. Variables must be the atomic "// &
69 "coordinates (X,Y,Z) of the grid.", usage=
"FUNCTION X^2+Y^2+Z^2+LOG(ABS(X+Y))", &
75 description=
"Defines the parameters of the functional form", &
76 usage=
"PARAMETERS a b D", type_of_var=
char_t, &
77 n_var=-1, repeats=.true.)
82 description=
"Defines the values of parameter of the functional form", &
83 usage=
"VALUES ", type_of_var=
real_t, &
84 n_var=-1, repeats=.true., unit_str=
"internal_cp2k")
89 description=
"Optionally, allows to define valid CP2K unit strings for each parameter value. "// &
90 "It is assumed that the corresponding parameter value is specified in this unit.", &
91 usage=
"UNITS angstrom eV*angstrom^-1 angstrom^1 K", type_of_var=
char_t, &
92 n_var=-1, repeats=.true.)
97 description=
"Specifies the external potential as STATIC or time dependent. At the moment "// &
98 "only static potentials are implemented.", &
99 usage=
"STATIC T", default_l_val=.true., lone_keyword_l_val=.true.)
104 description=
"Parameter used for computing the derivative with the Ridders' method.", &
105 usage=
"DX <REAL>", default_r_val=0.1_dp, unit_str=
"bohr")
110 description=
"Checks that the error in computing the derivative is not larger than "// &
111 "the value set; in case error is larger a warning message is printed.", &
112 usage=
"ERROR_LIMIT <REAL>", default_r_val=1.0e-12_dp)
117 CALL keyword_create(keyword, __location__, name=
"READ_FROM_CUBE", &
118 description=
"Switch for reading the external potential from file pot.cube. The values "// &
119 "of the potential must be on the grid points of the realspace grid.", &
120 usage=
"READ_FROM_CUBE T", default_l_val=.false., lone_keyword_l_val=.true.)
125 CALL keyword_create(keyword, __location__, name=
"SCALING_FACTOR", &
126 description=
"A factor for scaling the the external potential that is read from file. "// &
127 "The value of the potential at each grid point is multiplied by this factor.", &
128 usage=
"SCALING_FACTOR <REAL>", default_r_val=1.0_dp)
132 CALL create_maxwell_section(subsection)
144 SUBROUTINE create_maxwell_section(section)
149 cpassert(.NOT.
ASSOCIATED(section))
151 description=
"Section controlling the calculation of an electrostatic "// &
152 "external potential calculated from Maxwell equations. ", &
153 n_keywords=1, n_subsections=0, repeats=.false.)
157 description=
"Test for logical value", &
158 usage=
"TEST_LOGICAL T", default_l_val=.false., lone_keyword_l_val=.true.)
163 description=
"TEST for Real", &
164 usage=
"TEST_REAL <REAL>", default_r_val=1.0_dp)
169 description=
"TEST for Int", &
170 usage=
"TEST_INTEGER <INT>", default_i_val=0)
174 END SUBROUTINE create_maxwell_section
187 cpassert(.NOT.
ASSOCIATED(section))
188 CALL section_create(section, __location__, name=
"EXTERNAL_DENSITY", &
189 description=
"Section for the use of the ZMP technique on external densities.", &
190 n_keywords=4, n_subsections=0, repeats=.false., &
195 description=
"Specifies the filename containing the target density in *.cube format. "// &
196 "In the MGRID section it must be imposed NGRID 1, as it works with only "// &
197 "one grid. The number of points in each direction, and the spacing must "// &
198 "be previously defined choosing the plane waves cut-off in section MGRID "// &
199 "keyword CUTOFF, and the cube dimension in section SUBSYS / CELL / keyword ABC", &
200 usage=
"FILE_DENSITY <FILENAME>", &
201 type_of_var=
char_t, default_c_val=
"RHO_O.dat", n_var=-1)
206 description=
"Lagrange multiplier defined in the constraint ZMP method. When starting, use "// &
207 "small values when starting from scratch (around 5,10). Then gradually increase "// &
208 "the values depending, restarting from the previous calculation with the smaller "// &
209 "value. To choose the progressive values of LAMBDA look at the convergence of the "// &
211 usage=
"LAMBDA <REAL>", default_r_val=10.0_dp)
215 CALL keyword_create(keyword, __location__, name=
"ZMP_CONSTRAINT", &
216 description=
"Specify which kind of constraint to solve the ZMP equation. The COULOMB default "// &
217 "option is more stable.", &
218 usage=
"ZMP_CONSTRAINT <CHAR>", &
219 enum_c_vals=
s2a(
"COULOMB",
"DIFF",
"NONE"), &
221 enum_desc=
s2a(
"Coulomb constraint, integral of [rho_0(r)-rho(r)]/|r-r'|", &
222 "Simple constraint, [rho_0(r)-rho(r)]", &
223 "No constrain imposed"), &
229 description=
"Add the Fermi-Amaldi contribution to the Hartree potential. "// &
230 "It leads to a more stable convergence.", &
231 usage=
"FERMI_AMALDI <LOGICAL>", &
234 default_l_val=.true., lone_keyword_l_val=.true.)
251 cpassert(.NOT.
ASSOCIATED(section))
253 description=
"SCF convergence with external v_xc calculated through previous ZMP "// &
255 n_keywords=1, n_subsections=0, repeats=.false.)
259 description=
"The *.cube filename containing the v_xc potential. This works only "// &
260 "with NGRID 1 imposed in the MGRID section. The number of points in each "// &
261 "direction, and the spacing must equal to those previously used in the ZMP "// &
262 "calculation and defined through the plane wave cut-off and the cube dimension "// &
263 "respectively set in section MGRID / keyword CUTOFF, and in section SUBSYS / "// &
264 "CELL / keyword ABC", &
265 usage=
"FILE_VXC <FILENAME>", &
266 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.