Octopus
species_factory.F90
Go to the documentation of this file.
1!! Copyright (C) 2002-2006 M. Marques, A. Castro, A. Rubio, G. Bertsch
2!! Copyright (C) 2023-2024 N. Tancogne-Dejean
3!!
4!! This program is free software; you can redistribute it and/or modify
5!! it under the terms of the GNU General Public License as published by
6!! the Free Software Foundation; either version 2, or (at your option)
7!! any later version.
8!!
9!! This program is distributed in the hope that it will be useful,
10!! but WITHOUT ANY WARRANTY; without even the implied warranty of
11!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12!! GNU General Public License for more details.
13!!
14!! You should have received a copy of the GNU General Public License
15!! along with this program; if not, write to the Free Software
16!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17!! 02110-1301, USA.
18!!
19#include "global.h"
20
23 use debug_oct_m
25 use global_oct_m
26 use iihash_oct_m
27 use io_oct_m
31 use parser_oct_m
37 use unit_oct_m
39
40 implicit none
41
42 private
43 public :: &
47
48 type :: species_factory_t
49 private
50 logical :: initialized = .false.
51 integer :: default_pseudopotential_set_id
52 type(pseudo_set_t) :: default_pseudopotential_set
53 integer :: default_allelectron_type
54 real(real64) :: default_sigma
55 real(real64) :: default_anc_a
56 contains
57 procedure :: init => species_factory_init
58 procedure :: end => species_factory_end
59 procedure :: create_from_input => species_factory_create_from_input
60 procedure :: create_from_block => read_from_block
61 end type species_factory_t
62
63contains
64
65 ! ---------------------------------------------------------
66 subroutine species_factory_init(factory, namespace)
67 class(species_factory_t), intent(inout) :: factory
68 type(namespace_t), intent(in) :: namespace
69
70 integer :: ierr, default_val
71
72 if (factory%initialized) return
73
74 push_sub_with_profile(species_factory_init)
75
76 factory%initialized = .true.
77
78 call share_directory_set(conf%share)
79
80 !%Variable AllElectronType
81 !%Type integer
82 !%Default no
83 !%Section System::Species
84 !%Description
85 !% Selects the type of all-electron species that applies by default to all
86 !% atoms. This is not compatible with <tt>PseudopotentialSet</tt>, but it is
87 !% compatible with the <tt>Species</tt> block.
88 !%
89 !% The three types differ in what they support:
90 !% <tt>full_delta</tt> and <tt>full_anc</tt> work with curvilinear coordinates
91 !% (see <tt>CurvMethod</tt>), <tt>full_gaussian</tt> works with <tt>curv_gygi</tt> and
92 !% <tt>curv_modine</tt> but not with <tt>curv_briggs</tt>. For periodic systems,
93 !% <tt>full_gaussian</tt> is not implemented and <tt>full_anc</tt> is experimental.
94 !%
95 !% The relevant parameter is <tt>AllElectronSigma</tt> for <tt>full_gaussian</tt> and
96 !% <tt>AllElectronANCParam</tt> for <tt>full_anc</tt>; <tt>full_delta</tt> takes neither.
97 !% A parameter set for a type that does not use it is ignored, and a warning is printed.
98 !%
99 !%Option no 0
100 !% Do not specify any default all-electron type of species. All species must be
101 !% specified in the Species block.
102 !%Option full_delta 1
103 !% All atoms are supposed to be by default of type <tt>species_full_delta</tt>.
104 !%Option full_gaussian 2
105 !% All atoms are supposed to be by default of type <tt>species_full_gaussian</tt>.
106 !%Option full_anc 3
107 !% All atoms are supposed to be by default of type <tt>species_full_anc</tt>.
108 !%End
109 call parse_variable(namespace, 'AllElectronType', option__allelectrontype__no, factory%default_allelectron_type)
110 call messages_print_var_option('AllElectronType', factory%default_allelectron_type, namespace=namespace)
111
112 !%Variable AllElectronSigma
113 !%Type float
114 !%Default 0.6
115 !%Section System::Species
116 !%Description
117 !% Default value for the parameter <tt>gaussian_width</tt>. This is useful
118 !% for specifying multiple atoms without specifying the species block. The
119 !% default value is taken from the recommendation in
120 !% <i>Phys. Rev. B</i> <b>55</b>, 10289 (1997).
121 !%
122 !% Note that this is a width in units of the grid spacing, not a length: the
123 !% Gaussian exponent is <math>\zeta = 1/(2\sigma^2\delta^2)</math> with
124 !% <math>\delta</math> the spacing. Reducing <tt>Spacing</tt> at fixed
125 !% <math>\sigma</math> therefore shrinks the physical size of the nucleus, so a
126 !% spacing convergence study is not a convergence study of a single Hamiltonian.
127 !%
128 !% It is only used by <tt>species_full_gaussian</tt> and is ignored for the other
129 !% all-electron types.
130 !%End
131 call parse_variable(namespace, 'AllElectronSigma', 0.6_real64, factory%default_sigma)
133 !%Variable AllElectronANCParam
134 !%Type float
135 !%Default 4.0
136 !%Section System::Species
137 !%Description
138 !% Default value for the parameter <tt>anc_a</tt> of the <tt>species_full_anc</tt>
139 !% species, the parameter <i>a</i> of the analytic norm-conserving regularized Coulomb
140 !% potential of [Gygi, <i>J. Chem. Theory Comput.</i> <b>19</b>, 1300 (2023)]. This is
141 !% useful for specifying multiple atoms without specifying the species block.
142 !%
143 !% It has the dimension of an inverse length, and the code uses the scaled radius
144 !% <math>a Z r</math>, so the regularization length is <math>1/(aZ)</math> bohr and
145 !% depends on the atomic number. The default value of 4 has only been validated for
146 !% hydrogen; for a heavy atom it puts the regularization far below any usable grid
147 !% spacing, and a smaller value should be used.
148 !%
149 !% It is only used by <tt>species_full_anc</tt> and is ignored for the other
150 !% all-electron types.
151 !%End
152 call parse_variable(namespace, 'AllElectronANCParam', 4.0_real64, factory%default_anc_a)
153
154 ! These are valid variable names, so the parser cannot report them as unused.
155 if (parse_is_defined(namespace, 'AllElectronSigma') .and. &
156 factory%default_allelectron_type /= option__allelectrontype__full_gaussian) then
157 message(1) = "AllElectronSigma is only used by species_full_gaussian and will be ignored."
158 call messages_warning(1, namespace=namespace)
159 end if
160 if (parse_is_defined(namespace, 'AllElectronANCParam') .and. &
161 factory%default_allelectron_type /= option__allelectrontype__full_anc) then
162 message(1) = "AllElectronANCParam is only used by species_full_anc and will be ignored."
163 call messages_warning(1, namespace=namespace)
164 end if
165
166 !%Variable PseudopotentialSet
167 !%Type integer
168 !%Default standard
169 !%Section System::Species
170 !%Description
171 !% Selects the set of pseudopotentials used by default for species
172 !% not defined in the <tt>Species</tt> block.
173 !%
174 !% These sets of pseudopotentials come from different
175 !% sources. Octopus developers have not validated them. We include
176 !% them with the code for convenience of the users, but you are
177 !% expected to check the quality and suitability of the
178 !% pseudopotential for your application.
179 !%
180 !% Note that not all these pseudopotentials are compatible with spin-orbit coupling
181 !% Only hgh_lda, hgh_lda_sc and pseudodojo_pbe_fr provide SOC information.
182 !%
183 !%Option none 0
184 !% Do not load any pseudopotential by default. All species must be
185 !% specified in the Species block.
186 !%Option standard 1
187 !% The standard set of Octopus that provides LDA pseudopotentials
188 !% in the PSF format for some elements: H, Li, C, N, O, Na, Si, S, Ti, Se, Cd.
189 !%Option sg15 2
190 !% The set of Optimized Norm-Conserving Vanderbilt
191 !% PBE pseudopotentials. Ref: M. Schlipf and F. Gygi, <i>Comp. Phys. Commun.</i> <b>196</b>, 36 (2015).
192 !% This set provides pseudopotentials for elements up to Z = 83
193 !% (Bi), excluding Lanthanides.
194 !% Current version of the set is 1.2.
195 !%Option hgh_lda 3
196 !% The set of Hartwigsen-Goedecker-Hutter LDA pseudopotentials for elements from H to Rn.
197 !% Ref: C. Hartwigsen, S. Goedecker, and J. Hutter, <i>Phys. Rev. B</i> <b>58</b>, 3641 (1998).
198 !%Option hgh_lda_sc 31
199 !% The semicore set of Hartwigsen-Goedecker-Hutter LDA pseudopotentials.
200 !% Ref: C. Hartwigsen, S. Goedecker, and J. Hutter, <i>Phys. Rev. B</i> <b>58</b>, 3641 (1998).
201 !%Option hscv_lda 4
202 !% The set of Hamann-Schlueter-Chiang-Vanderbilt (HSCV) potentials
203 !% for LDA exchange and correlation downloaded from http://fpmd.ucdavis.edu/potentials/index.htm.
204 !% These pseudopotentials were originally intended for the QBox
205 !% code. They were generated using the method of Hamann, Schluter
206 !% and Chiang. Ref: D. Vanderbilt, <i>Phys. Rev. B</i> <b>32</b>, 8412 (1985).
207 !% Warning from the original site: The potentials provided in this
208 !% site are distributed without warranty. In most cases,
209 !% potentials were not tested. Potentials should be thoroughly
210 !% tested before being used in simulations.
211 !%Option hscv_pbe 5
212 !% PBE version of the HSCV pseudopotentials. Check the
213 !% documentation of the option <tt>hscv_lda</tt> for details and warnings.
214 !%Option gbrv_lda 6
215 !% The GBRV set of ultrasoft LDA pseudopotentials.
216 !% Ref: K. F. Garrity, J. W. Bennett, K. M. Rabe, and D. Vanderbilt,
217 !% <i>Comput. Mater. Sci.</i> <b>81</b>, 446 (2014).
218 !% This set provides ultrasoft pseudopotentials for most elements up to
219 !% Z = 82 (Pb), excluding noble gases and Lanthanides. The files come from
220 !% the GBRV releases 1 to 1.5. Note that ultrasoft pseudopotentials are an
221 !% experimental feature.
222 !%Option pseudodojo_pbe 100
223 !% PBE version of the pseudopotentials of http://pseudo-dojo.org. Version 0.5
224 !%Option pseudodojo_lda 103
225 !% LDA pseudopotentials of http://pseudo-dojo.org. Version 0.41.
226 !%Option pseudodojo_pbesol 105
227 !% PBEsol version of the pseudopotentials of http://pseudo-dojo.org. Version 0.41.
228 !%Option pseudodojo_pbe_fr 106
229 !% Fully-relativistic PBE version of the pseudopotentials of http://pseudo-dojo.org. Version 0.4.
230 !%End
231 default_val = option__pseudopotentialset__standard
232 if(factory%default_allelectron_type /= option__allelectrontype__no) default_val = option__pseudopotentialset__none
233 call parse_variable(namespace, 'PseudopotentialSet', default_val, factory%default_pseudopotential_set_id)
234 call messages_print_var_option('PseudopotentialSet', factory%default_pseudopotential_set_id, namespace=namespace)
235 if (factory%default_pseudopotential_set_id /= option__pseudopotentialset__none) then
236 call pseudo_set_init(factory%default_pseudopotential_set, get_set_directory(factory%default_pseudopotential_set_id), ierr)
237 else
238 call pseudo_set_nullify(factory%default_pseudopotential_set)
239 end if
240
241 if (factory%default_pseudopotential_set_id /= option__pseudopotentialset__none &
242 .and. factory%default_allelectron_type /= option__allelectrontype__no) then
243 message(1) = "PseudopotentialSet /= none cannot be used with AllElectronType /= no."
244 call messages_fatal(1, namespace=namespace)
245 end if
246
247 pop_sub_with_profile(species_factory_init)
248 end subroutine species_factory_init
249
250 ! ---------------------------------------------------------
251
252 subroutine species_factory_end(factory)
253 class(species_factory_t), intent(inout) :: factory
254
255 push_sub(species_factory_end)
256
257 if (factory%initialized) then
258 call pseudo_set_end(factory%default_pseudopotential_set)
259 factory%initialized = .false.
260 end if
261
262 pop_sub(species_factory_end)
263 end subroutine species_factory_end
264
265
266 ! ---------------------------------------------------------
271 ! ---------------------------------------------------------
272 function species_factory_create_from_input(factory, namespace, label, index) result(spec)
273 class(species_factory_t), intent(in) :: factory
274 type(namespace_t), intent(in) :: namespace
275 character(len=*), intent(in) :: label
276 integer, intent(in) :: index
277 class(species_t), pointer :: spec
278
279 character(len=LABEL_LEN) :: lab
280 integer :: ib, row, n_spec_block, read_data
281 type(block_t) :: blk
282 type(element_t) :: element
283
285
286 read_data = 0
287
288 !%Variable Species
289 !%Type block
290 !%Section System::Species
291 !%Description
292 !% A species is by definition either an "ion" (nucleus + core electrons) described
293 !% through a pseudopotential, or a model potential.
294 !%
295 !% Note that some sets of pseudopotentials are distributed with
296 !% the code. To use these pseudopotentials, you do not need to define them
297 !% explicitly in the <tt>Species</tt> block, as default parameters
298 !% are provided.
299 !% You can select the set for default pseudopotentials using the
300 !% <tt>PseudopotentialSet</tt> variable.
301 !%
302 !% Supported norm-conserving pseudopotential formats are
303 !% detected by the file extension: UPF (<tt>.upf</tt>), PSF (SIESTA, <tt>.psf</tt>), FHI (ABINIT 6, <tt>.fhi</tt>),
304 !% CPI (Fritz-Haber, <tt>.cpi</tt>), QSO (quantum-simulation.org, for Qbox, <tt>.xml</tt>),
305 !% HGH (Hartwigsen-Goedecker-Hutter, <tt>.hgh</tt>).
306 !% PSPIO format can also be used via <tt>species_pspio</tt> if that library is linked.
307 !% Note: pseudopotentials may only be used in 3D.
308 !%
309 !% The format of this block is the following: The first field is a
310 !% string that defines the name of the species. The second field
311 !% defines the type of species (the valid options are detailed
312 !% below).
313 !%
314 !% Then a list of parameters follows. The parameters are specified
315 !% by a first field with the parameter name and the field that
316 !% follows with the value of the parameter. Some parameters are
317 !% specific to a certain species while others are accepted by all
318 !% species. These are <tt>mass</tt>, <tt>max_spacing</tt>, and <tt>min_radius</tt>.
319 !%
320 !% These are examples of possible species:
321 !%
322 !% <tt>%Species
323 !% <br>&nbsp;&nbsp;'O' | species_pseudo | file | 'O.psf' | lmax | 1 | lloc | 1
324 !% <br>&nbsp;&nbsp;'H' | species_pseudo | file | '../H.hgh'
325 !% <br>&nbsp;&nbsp;'Xe' | species_pseudo | set | pseudojo_pbe
326 !% <br>&nbsp;&nbsp;'C' | species_pseudo | file | "carbon.xml"
327 !% <br>&nbsp;&nbsp;'jlm' | species_jellium | jellium_radius | 5.0
328 !% <br>&nbsp;&nbsp;'rho' | species_charge_density | density_formula | "exp(-r/a)" | mass | 17.0 | valence | 6
329 !% <br>&nbsp;&nbsp;'udf' | species_user_defined | potential_formula | "1/2*r^2" | valence | 8
330 !% <br>&nbsp;&nbsp;'He_all' | species_full_delta
331 !% <br>&nbsp;&nbsp;'H_all' | species_full_gaussian | gaussian_width | 0.2
332 !% <br>&nbsp;&nbsp;'Li1D' | species_soft_coulomb | softening | 1.5 | valence | 3
333 !% <br>&nbsp;&nbsp;'H_all' | species_full_anc | anc_a | 4
334 !% <br>%</tt>
335 !%Option species_pseudo -7
336 !% The species is a pseudopotential. How to get the
337 !% pseudopotential can be specified by the <tt>file</tt> or
338 !% the <tt>set</tt> parameters. If both are missing, the
339 !% pseudopotential will be taken from the <tt>PseudopotentialSet</tt>
340 !% specified for the run, this is useful if you want to change
341 !% some parameters of the pseudo, like the <tt>mass</tt>.
342 !%
343 !% The optional parameters for this type of species are
344 !% <tt>lmax</tt>, that defines the maximum angular momentum
345 !% component to be used, and <tt>lloc</tt>, that defines the
346 !% angular momentum to be considered as local. When these
347 !% parameters are not set, the value for lmax is the maximum
348 !% angular component from the pseudopotential file. The default
349 !% value for <tt>lloc</tt> is taken from the pseudopotential if
350 !% available, if not, it is set to 0. Note that, depending on the
351 !% type of pseudopotential, it might not be possible to select
352 !% <tt>lmax</tt> and <tt>lloc</tt>, if that is the case the
353 !% parameters will be ignored.
354 !%
355 !%Option species_pspio -110
356 !% (experimental) Alternative method to read pseudopotentials
357 !% using the PSPIO library. This species uses the same parameters
358 !% as <tt>species_pseudo</tt>.
359 !%Option species_user_defined -123
360 !% Species with user-defined potential. The potential for the
361 !% species is defined by the formula given by the <tt>potential_formula</tt>
362 !% parameter.
363 !% The
364 !% <tt>valence</tt> parameter determines the number of electrons
365 !% associated with the species. By default, a valence of 0 is assumed.
366 !%Option species_charge_density -125
367 !% The potential for this species is created from the distribution
368 !% of charge given by the <tt>density_formula</tt> parameter.
369 !% The
370 !% <tt>valence</tt> parameter determines the number of electrons
371 !% associated with the species. By default, a valence of 0 is assumed.
372 !%Option species_point -3
373 !%Option species_jellium -3
374 !% Jellium sphere.
375 !% The charge associated with this species must be given by the <tt>valence</tt> parameter.
376 !%Option species_jellium_slab -4
377 !% A slab of jellium that extends across the simulation box in the
378 !% <i>xy</i>-plane. The dimension along the <i>z</i> direction is
379 !% determined by the required parameter <tt>thickness</tt>.
380 !% The charge associated with this species must be given by the <tt>valence</tt> parameter.
381 !%Option species_full_delta -127
382 !% Full atomic potential represented by a delta charge
383 !% distribution. The atom will be displaced to the nearest grid
384 !% point. The atomic number is determined from the name of the species.
385 !%Option species_full_anc -130
386 !% Analytical norm-conserving regularized Coulomb potential from
387 !% [Gygi J. Chem. Theory Comput. 2023, 19, 1300−1309].
388 !% Unlike <tt>species_full_delta</tt> and <tt>species_full_gaussian</tt>, this species has
389 !% no nuclear charge density: the potential is applied directly, without solving a Poisson
390 !% equation for the nucleus. The <tt>External</tt> and <tt>Hartree</tt> components reported
391 !% in <tt>static/info</tt> are therefore split differently than for the other two types.
392 !%Option species_full_gaussian -124
393 !% A full-potential atom is defined by a Gaussian accumulation of
394 !% positive charge, in the form:
395 !%
396 !% <math>\rho(r) = Z (\zeta/\pi)^{3/2} e^{-\zeta (\vec{r}-\vec{r_0})^2}</math>
397 !%
398 !% with <math>\zeta = 1/(2\sigma^2\delta^2)</math> in bohr<sup>-2</sup>, where
399 !% <math>\sigma</math> is set by the parameter <tt>gaussian_width</tt> and
400 !% <math>\delta</math> is the grid spacing (the grid spacing in the first dimension,
401 !% to be precise). The prefactor maintains proper normalization: the integral of
402 !% <math>\rho</math> sums up to <math>Z</math>.
403 !% <math>\vec{r_0}</math> is calculated in such a way that the
404 !% first moment of <math>\rho(r)/Z</math> is equal to the atomic
405 !% position. For a precise description, see N. A. Modine,
406 !% <i>Phys. Rev. B</i> <b>55</b>, 10289 (1997).
407 !%
408 !% The Gaussian is built in the primitive coordinates of the mesh, whose spacing is
409 !% uniform, so with curvilinear coordinates it is narrower in real space where the grid
410 !% is denser. This works with <tt>curv_gygi</tt> and <tt>curv_modine</tt>, but not with
411 !% <tt>curv_briggs</tt>, and not for periodic systems.
412 !% The atomic number is determined from the name of the species.
413 !%Option species_from_file -126
414 !% The potential is read from a file. Accepted file formats, detected by extension: obf, ncdf and csv.
415 !% The
416 !% <tt>valence</tt> parameter determines the number of electrons
417 !% associated with the species. By default, a valence of 0 is assumed.
418 !%Option species_soft_coulomb -128
419 !% The potential is a soft-Coulomb function, <i>i.e.</i> a function in the form:
420 !%
421 !% <math>v(r) = - z_{val} / \sqrt{a^2 + r^2}</math>
422 !%
423 !% The value of <i>a</i> should be given by the mandatory <tt>softening</tt> parameter.
424 !% The charge associated with this species must be given by the <tt>valence</tt> parameter.
425 !%Option species_jellium_charge_density -129
426 !% The parameter is the name of a volume block specifying the shape of the jellium.
427 !%Option lmax -10003
428 !% The maximum angular-momentum channel that will be used for the pseudopotential.
429 !%Option lloc -10004
430 !% The angular-momentum channel of the pseudopotential to be considered local.
431 !%Option mass -10005
432 !% The mass of the species in atomic mass units, <i>i.e.</i> the mass of a proton is
433 !% roughly one. It is set automatically for pseudopotentials from the
434 !% <a href=http://www.nist.gov/pml/data/comp.cfm>NIST values</a>.
435 !% For other species, the default is 1.0.
436 !%Option valence -10006
437 !% The number of electrons of the species. It is set automatically from the name of the species.
438 !% if it correspond to the name in the periodic table. If not specified and if the name
439 !% does not match an atom name, a value of 0 is assumed.
440 !%Option jellium_radius -10007
441 !% The radius of the sphere for <tt>species_jellium</tt>. If this value is not specified,
442 !% the default of 0.5 bohr is used.
443 !%Option set -10017
444 !% For a <tt>species_pseudo</tt>, get the pseudopotential from a
445 !% particular set. This flag must be followed with one of the
446 !% valid values for the variable <tt>PseudopotentialSet</tt>.
447 !%Option gaussian_width -10008
448 !% The width <math>\sigma</math> of the Gaussian (in units of the grid spacing) used to
449 !% represent the nuclear charge for <tt>species_full_gaussian</tt>. If not present, the
450 !% value of <tt>AllElectronSigma</tt> is used, which itself defaults to 0.6. See
451 !% <tt>AllElectronSigma</tt> for the consequences of tying the nuclear size to the grid.
452 !%Option softening -10009
453 !% The softening parameter <i>a</i> for <tt>species_soft_coulomb</tt> in units of length.
454 !%Option file -10010
455 !% The path for the file that describes the species.
456 !%Option db_file -10011
457 !% Obsolete. Use the <tt>set</tt> option of the <tt>PseudopotentialSet</tt> variable instead.
458 !%Option potential_formula -10012
459 !% Mathematical expression that defines the potential for <tt>species_user_defined</tt>. You can use
460 !% any of the <i>x</i>, <i>y</i>, <i>z</i> or <i>r</i> variables.
461 !%Option density_formula -10013
462 !% Mathematical expression that defines the charge density for <tt>species_charge_density</tt>. You can use
463 !% any of the <i>x</i>, <i>y</i>, <i>z</i> or <i>r</i> variables.
464 !%Option thickness -10014
465 !% The thickness of the slab for species_jellium_slab. Must be positive.
466 !%Option vdw_radius -10015
467 !% The van der Waals radius that will be used for this species.
468 !%Option volume -10016
469 !% Name of a volume block
470 !%Option hubbard_l -10018
471 !% The angular-momentum for which the effective U will be applied.
472 !%Option hubbard_u -10019
473 !% The effective U that will be used for the DFT+U calculations.
474 !%Option hubbard_j -10020
475 !% The value of j (hubbard_l-1/2 or hubbard_l+1/2) on which the effective U is applied.
476 !%Option hubbard_alpha -10021
477 !% The strength of the potential constraining the occupations of the localized subspace
478 !% as defined in PRB 71, 035105 (2005)
479 !%Option anc_a -10022
480 !% The value of the parameter a of the ANC potential, as defined in [Gygi, JCTC 2023, 19, 1300−1309].
481 !% This parameter has the unit of inverse length and determines the range of regularization.
482 !% The code scales the radius as <math>a Z r</math>, so the regularization length is
483 !% <math>1/(aZ)</math> bohr and shrinks with the atomic number. If not present, the value of
484 !% <tt>AllElectronANCParam</tt> is used, which defaults to 4, a value validated for hydrogen
485 !% only.
486 !%End
487
488 call messages_obsolete_variable(namespace, 'SpecieAllElectronSigma', 'Species')
489 call messages_obsolete_variable(namespace, 'SpeciesAllElectronSigma', 'Species')
490
491 ! First, find out if there is a Species block.
492 n_spec_block = 0
493 if (parse_block(namespace, 'Species', blk) == 0) then
494 n_spec_block = parse_block_n(blk)
495 end if
496
497 ! Find out if the sought species is in the block
498 row = -1
499 block: do ib = 1, n_spec_block
500 call parse_block_string(blk, ib-1, 0, lab)
501 if (trim(lab) == trim(label)) then
502 row = ib - 1
503 exit block
504 end if
505 end do block
506
507 ! Read whatever may be read from the block
508 if (row >= 0) then
509 spec => factory%create_from_block(namespace, blk, row, label, index, read_data)
510 call parse_block_end(blk)
511
512 assert(read_data > 0)
513
515 return
516 end if
517
518 ! We get here if there is a Species block but it does not contain
519 ! the species we are looking for.
520 if (n_spec_block > 0) call parse_block_end(blk)
521
522 ! Initialize all electron species (except soft-Coulomb) from specified allelectron type
523 if(factory%default_allelectron_type /= option__allelectrontype__no) then
524 select case(factory%default_allelectron_type)
525 case(option__allelectrontype__full_delta)
526 spec => full_delta_t(label, index, factory%default_sigma)
527 case(option__allelectrontype__full_gaussian)
528 spec => full_gaussian_t(label, index, factory%default_sigma)
529 case(option__allelectrontype__full_anc)
530 spec => full_anc_t(label, index, factory%default_anc_a)
531 case default
532 assert(.false.)
533 end select
534
535 ! get the mass, vdw radius and atomic number for this element
536 call element_init(element, get_symbol(spec%get_label()))
537
538 assert(element_valid(element))
539
540 call spec%set_z(real(element_atomic_number(element), real64))
541 call spec%set_zval(spec%get_z())
542 call spec%set_mass(element_mass(element))
543 call spec%set_vdw_radius(element_vdw_radius(element))
544
545 call element_end(element)
546
547 else ! Pseudopotential from specified set or the default one
548 spec => pseudopotential_t(label, index)
549 select type(spec)
550 type is(pseudopotential_t)
551 call read_from_set(spec, factory%default_pseudopotential_set_id, factory%default_pseudopotential_set, read_data)
552
553 if (read_data == 0) then
554 call messages_write( 'Species '//trim(spec%get_label())//' not found in default pseudopotential set.', new_line=.true. )
555 call messages_write('( '//trim(get_set_directory(factory%default_pseudopotential_set_id))//' )')
556 call messages_fatal(namespace=namespace)
557 end if
558 end select
559 end if
560
563
564!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
565! Private procedures
566
567 ! ---------------------------------------------------------
569 function read_from_block(factory, namespace, blk, row, label, index, read_data) result(spec)
570 class(species_factory_t), intent(in) :: factory
571 type(namespace_t), intent(in) :: namespace
572 type(block_t), intent(in) :: blk
573 integer, intent(in) :: row
574 character(len=*), intent(in) :: label
575 integer, intent(in) :: index
576 integer, intent(out):: read_data
577 class(species_t), pointer :: spec
578
579 integer :: ncols, icol, flag, set_read_data, ierr, type
580 type(element_t) :: element
581 type(iihash_t) :: read_parameters
582 integer :: user_lmax, user_llocal, hubbard_l, pseudopotential_set_id
583 real(real64) :: hubbard_u, hubbard_j, hubbard_alpha, mass, z_val, jradius, jthick, vdw_radius, aa
584 real(real64) :: sigma, softening
585 character(len=MAX_PATH_LEN) :: filename
586
587 integer, parameter :: &
588 species_jellium = 3, & !< jellium sphere.
591 species_pseudo = 7, &
592 species_pspio = 110, &
593 species_usdef = 123, &
594 species_full_gaussian = 124, &
595 species_charge_density = 125, &
596 species_from_file = 126, &
597 species_full_delta = 127, &
598 species_soft_coulomb = 128, &
599 species_full_anc = 130
600
601 push_sub(read_from_block)
602
603 ncols = parse_block_cols(blk, row)
604 read_data = 0
605
606 call parse_block_integer(blk, row, 1, type)
607
608 ! To detect the old species block format, options are represented
609 ! as negative values. If we get a non-negative value we know we
610 ! are reading a mass.
611 if (type >= 0) then
612 call messages_write('Found a species with the old format. Please update', new_line = .true.)
613 call messages_write('the Species block to the new format, where the second', new_line = .true.)
614 call messages_write('column indicates the type of the species.')
615 call messages_fatal(namespace=namespace)
616 end if
617
618 ! now we convert back to positive
619 type = -type
620
621 read_data = 2
622
623
624 select case (type)
625
626 case (species_soft_coulomb)
627 spec => soft_coulomb_t(label, index)
628
629 case (species_usdef) ! user-defined
630 spec => species_user_defined_t(label, index)
631
632 case (species_from_file)
633 spec => species_from_file_t(label, index)
634
635 case (species_jellium)
636 spec => jellium_sphere_t(label, index)
637
639 spec => jellium_slab_t(label, index)
640
641 case (species_full_delta)
642 spec => full_delta_t(label, index, factory%default_sigma)
643
644 case (species_full_gaussian)
645 spec => full_gaussian_t(label, index, factory%default_sigma)
646
647 case (species_full_anc)
648 spec => full_anc_t(label, index, factory%default_anc_a)
649
651 spec => species_charge_density_t(label, index)
652
654 spec => jellium_charge_t(label, index)
655
656 case (species_pseudo)
657 spec => pseudopotential_t(label, index)
658
659 case (species_pspio) ! a pseudopotential file to be handled by the pspio library
660 spec => pseudopotential_t(label, index)
661
662 case default
663 call messages_input_error(namespace, 'Species', "Unknown type for species '"//trim(spec%get_label())//"'", row=row, column=1)
664 end select
665
666 call spec%set_mass(-m_one)
667 call spec%set_vdw_radius(-m_one)
668 call spec%set_zval(-m_one)
669
670 call iihash_init(read_parameters)
671
672 icol = read_data
673 do
674 if (icol >= ncols) exit
675
676 call parse_block_integer(blk, row, icol, flag)
677
678 select case (flag)
679
680 case (option__species__lmax)
681 call check_duplication(option__species__lmax)
682 call parse_block_integer(blk, row, icol + 1, user_lmax)
683
684 select type(spec)
685 class is(pseudopotential_t)
686 call spec%set_user_lmax(user_lmax)
687 class default
688 call messages_input_error(namespace, 'Species', &
689 "The 'lmax' parameter in species "//trim(spec%get_label())//" can only be used with pseudopotential species", &
690 row=row, column=icol+1)
691 end select
692
693 if (user_lmax < 0) then
694 call messages_input_error(namespace, 'Species', &
695 "The 'lmax' parameter in species "//trim(spec%get_label())//" cannot be negative", &
696 row=row, column=icol+1)
697 end if
698
699 case (option__species__lloc)
700 call check_duplication(option__species__lloc)
701 call parse_block_integer(blk, row, icol + 1, user_llocal)
702
703 select type(spec)
704 class is(pseudopotential_t)
705 call spec%set_user_lloc(user_llocal)
706 class default
707 call messages_input_error(namespace, 'Species', &
708 "The 'lloc' parameter in species "//trim(spec%get_label())//" can only be used with pseudopotential species", &
709 row=row, column=icol+1)
710 end select
711
712 if (user_llocal < 0) then
713 call messages_input_error(namespace, 'Species', &
714 "The 'lloc' parameter in species "//trim(spec%get_label())//" cannot be negative", row=row, column=icol+1)
715 end if
716
717 case (option__species__hubbard_l)
718 call check_duplication(option__species__hubbard_l)
719 call parse_block_integer(blk, row, icol + 1, hubbard_l)
720
721 select type(spec)
722 class is(pseudopotential_t)
723 call spec%set_hubbard_l(hubbard_l)
724 class default
725 call messages_input_error(namespace, 'Species', &
726 "The 'hubbard_l' parameter in species "//trim(spec%get_label())//" can only be used with pseudopotential species", &
727 row=row, column=icol+1)
728 end select
729
730 if (hubbard_l < 0) then
731 call messages_input_error(namespace, 'Species', &
732 "The 'hubbard_l' parameter in species "//trim(spec%get_label())//" cannot be negative", row=row, column=icol+1)
733 end if
734
735 case (option__species__hubbard_u)
736 call check_duplication(option__species__hubbard_u)
737 call parse_block_float(blk, row, icol + 1, hubbard_u, unit = units_inp%energy)
738 call spec%set_hubbard_u(hubbard_u)
739
740 case (option__species__hubbard_alpha)
741 call check_duplication(option__species__hubbard_alpha)
742 call parse_block_float(blk, row, icol + 1, hubbard_alpha, unit = units_inp%energy)
743 call spec%set_hubbard_alpha(hubbard_alpha)
744
745 case (option__species__hubbard_j)
746 call check_duplication(option__species__hubbard_j)
747 call parse_block_float(blk, row, icol + 1, hubbard_j)
748 call spec%set_hubbard_j(hubbard_j)
749
750 if (abs(abs(spec%get_hubbard_j()-spec%get_hubbard_l())-m_half) <= m_epsilon) then
751 call messages_input_error(namespace, 'Species', "The 'hubbard_j' parameter in species "// &
752 trim(spec%get_label())//" can only be hubbard_l +/- 1/2", row=row, column=icol+1)
753 end if
754
755 case (option__species__mass)
756 call check_duplication(option__species__mass)
757 call parse_block_float(blk, row, icol + 1, mass, unit = units_inp%mass)
758 call spec%set_mass(mass)
759
760 case (option__species__valence)
761 call check_duplication(option__species__valence)
762 call parse_block_float(blk, row, icol + 1, z_val)
763 call spec%set_zval(z_val)
764 call spec%set_z(z_val)
765
766 case (option__species__jellium_radius)
767 call check_duplication(option__species__jellium_radius)
768 call parse_block_float(blk, row, icol + 1, jradius)
769 if (jradius <= m_zero) call messages_input_error(namespace, 'Species', 'jellium_radius must be positive', &
770 row=row, column=icol+1)
771
772 select type(spec)
773 type is(jellium_sphere_t)
774 call spec%set_radius(jradius)
775 class default
776 call messages_input_error(namespace, 'Species', 'jellium_radius can only be used with species_jellium', &
777 row=row, column=icol+1)
778 end select
779
780 case (option__species__gaussian_width)
781 call check_duplication(option__species__gaussian_width)
782 call parse_block_float(blk, row, icol + 1, sigma)
783 if (sigma <= m_zero) call messages_input_error(namespace, 'Species', 'gaussian_width must be positive', &
784 row=row, column=icol+1)
785 select type(spec)
786 type is(full_gaussian_t)
787 call spec%set_sigma(sigma)
788 class default
789 call messages_input_error(namespace, 'Species', 'gaussian_width can only be used with species_full_gaussian', &
790 row=row, column=icol+1)
791 end select
792
793 case (option__species__anc_a)
794 call check_duplication(option__species__anc_a)
795 call parse_block_float(blk, row, icol + 1, aa)
796 if (aa <= m_zero) call messages_input_error(namespace, 'Species', 'anc_a must be positive', &
797 row=row, column=icol+1)
798
799 select type(spec)
800 type is(full_anc_t)
801 call spec%set_a(aa)
802 class default
803 call messages_input_error(namespace, 'Species', 'anc_a can only be used with species_full_anc', &
804 row=row, column=icol+1)
805 end select
806
807 case (option__species__softening)
808 call check_duplication(option__species__softening)
809 call parse_block_float(blk, row, icol + 1, softening)
810 softening = softening**2
811
812 select type(spec)
813 type is(soft_coulomb_t)
814 call spec%set_softening2(softening)
815 class default
816 call messages_input_error(namespace, 'Species', 'softening can only be used with species_soft_coulomb', &
817 row=row, column=icol+1)
818 end select
819
820 case (option__species__file)
821 call check_duplication(option__species__file)
822 call parse_block_string(blk, row, icol + 1, filename)
823 call spec%set_filename(filename)
824
825 case (option__species__db_file)
826 call messages_write("The 'db_file' option for 'Species' block is obsolete. Please use", new_line = .true.)
827 call messages_write("the option 'set' or the variable 'PseudopotentialSet' instead.")
828 call messages_fatal(namespace=namespace)
829
830 case (option__species__set)
831 call check_duplication(option__species__set)
832 call parse_block_integer(blk, row, icol + 1, pseudopotential_set_id)
833
834 select type(spec)
835 type is(pseudopotential_t)
836 spec%pseudopotential_set_initialized = .true.
837 spec%pseudopotential_set_id = pseudopotential_set_id
838 call pseudo_set_init(spec%pseudopotential_set, get_set_directory(spec%pseudopotential_set_id), ierr)
839 class default
840 call messages_input_error(namespace, 'Species', 'set can only be used with species_pseudo', &
841 row=row, column=icol+1)
842 end select
843
844 case (option__species__potential_formula)
845 call check_duplication(option__species__potential_formula)
846 select type(spec)
848 call parse_block_string(blk, row, icol + 1, spec%potential_formula, convert_to_c=.true.)
849 class default
850 call messages_input_error(namespace, 'Species', 'potential_formula can only be used with species_user_defined', &
851 row=row, column=icol+1)
852 end select
853
854 case (option__species__volume)
855 call check_duplication(option__species__volume)
856
857 select type(spec)
858 type is(jellium_charge_t)
859 call parse_block_string(blk, row, icol + 1, spec%density_formula, convert_to_c=.true.)
860
861 class default
862 call messages_input_error(namespace, 'Species', 'volume can only be used with species_jellium_charge_density', &
863 row=row, column=icol+1)
864 end select
865
866 case (option__species__density_formula)
867 call check_duplication(option__species__density_formula)
868
869 select type(spec)
871 call parse_block_string(blk, row, icol + 1, spec%density_formula, convert_to_c=.true.)
872
873 class default
874 call messages_input_error(namespace, 'Species', 'density_formula can only be used with species_charge_density', &
875 row=row, column=icol+1)
876 end select
877
878 case (option__species__thickness)
879 call check_duplication(option__species__thickness)
880 call parse_block_float(blk, row, icol + 1, jthick) ! thickness of the jellium slab
881
882 if (jthick <= m_zero) then
883 call messages_input_error(namespace, 'Species', 'the value of the thickness parameter in species '&
884 //trim(spec%get_label())//' must be positive.', row=row, column=icol+1)
885 end if
886
887 select type(spec)
888 type is(jellium_slab_t)
889 call spec%set_thickness(jthick)
890 class default
891 call messages_input_error(namespace, 'Species', 'thickness can only be used with species_jellium_slab', &
892 row=row, column=icol+1)
893 end select
894
895 case (option__species__vdw_radius)
896 call check_duplication(option__species__vdw_radius)
897 call parse_block_float(blk, row, icol + 1, vdw_radius, unit = units_inp%length)
898 call spec%set_vdw_radius(vdw_radius)
899
900 case default
901 call messages_input_error(namespace, 'Species', "Unknown parameter in species '"//trim(spec%get_label())//"'", &
902 row=row, column=icol)
903
904 end select
905
906 icol = icol + 2
907 end do
908 ! CHECK THAT WHAT WE PARSED MAKES SENSE
909
910 select type(spec)
911 type is(soft_coulomb_t)
912 if (.not. parameter_defined(option__species__softening)) then
913 call messages_input_error(namespace, 'Species', &
914 "The 'softening' parameter is missing for species "//trim(spec%get_label()))
915 end if
916
918 if (.not. parameter_defined(option__species__potential_formula)) then
919 call messages_input_error(namespace, 'Species', &
920 "The 'potential_formula' parameter is missing for species '"//trim(spec%get_label())//"'")
921 end if
922
924 if (.not. parameter_defined(option__species__density_formula)) then
925 call messages_input_error(namespace, 'Species', &
926 "The 'density_formula' parameter is missing for species '"//trim(spec%get_label())//"'")
927 end if
928
929 type is(species_from_file_t)
930 if( .not. (parameter_defined(option__species__file) .or. parameter_defined(option__species__db_file))) then
931 call messages_input_error(namespace, 'Species', &
932 "The 'file' or 'db_file' parameter is missing for species '"//trim(spec%get_label())//"'")
933 end if
934
935 type is(jellium_slab_t)
936 if (.not. parameter_defined(option__species__thickness)) then
937 call messages_input_error(namespace, 'Species', &
938 "The 'thickness' parameter is missing for species '"//trim(spec%get_label())//"'")
939 end if
940
941 type is(jellium_charge_t)
942 if (.not. parameter_defined(option__species__volume)) then
943 call messages_input_error(namespace, 'Species', &
944 "The 'volume' parameter is missing for species '"//trim(spec%get_label())//"'")
945 end if
946
947 type is(pseudopotential_t)
948 if (parameter_defined(option__species__lmax) .and. parameter_defined(option__species__lloc)) then
949 if (spec%get_user_lloc() > spec%get_user_lmax()) then
950 call messages_input_error(namespace, 'Species', &
951 "the 'lloc' parameter cannot be larger than the 'lmax' parameter in species "//trim(spec%get_label()))
952 end if
953 end if
954
955 if(.not. (parameter_defined(option__species__file) .or. parameter_defined(option__species__db_file))) then
956 ! we need to read the species from the pseudopotential set
957
958 !if the set was not defined, use the default set
959 if (.not. parameter_defined(option__species__set)) then
960 spec%pseudopotential_set_id = factory%default_pseudopotential_set_id
961 spec%pseudopotential_set = factory%default_pseudopotential_set
962 end if
963
964 call read_from_set(spec, spec%pseudopotential_set_id, spec%pseudopotential_set, set_read_data)
965
966 if (set_read_data == 0) then
967 call messages_write('Species '//trim(spec%get_label())//' is not defined in the requested pseudopotential set.', &
968 new_line=.true.)
969 call messages_write('( '//trim(get_set_directory(spec%pseudopotential_set_id))//' )')
970 call messages_fatal(namespace=namespace)
971 end if
972 end if
973
974 end select
975
976 select type (spec)
977 class is(pseudopotential_t)
979
980 class is(full_anc_t)
982
983 ! If z_val was not specified, we set it to be z
984 if (spec%get_zval() < m_zero) then
985 call spec%set_zval(spec%get_z())
986 end if
987
988 class is(full_gaussian_t)
990
991 ! If z_val was not specified, we set it to be z
992 if (spec%get_zval() < m_zero) then
993 call spec%set_zval(spec%get_z())
994 end if
995
996 class is(full_delta_t)
998
999 ! If z_val was not specified, we set it to be z
1000 if (spec%get_zval() < m_zero) then
1001 call spec%set_zval(spec%get_z())
1002 end if
1003
1004 class default
1005 if (.not. parameter_defined(option__species__mass)) then
1006 call spec%set_mass(m_one)
1007 call messages_write('Info: default mass for species '//trim(spec%get_label())//':')
1008 call messages_write(spec%get_mass())
1009 call messages_write(' amu.')
1010 call messages_info(namespace=namespace)
1011 end if
1012
1013 if (.not. parameter_defined(option__species__vdw_radius)) then
1014 call spec%set_vdw_radius(m_zero)
1015 call messages_write('Info: default vdW radius for species '//trim(spec%get_label())//':')
1016 call messages_write(spec%get_vdw_radius())
1017 call messages_write(' [b]')
1018 call messages_info(namespace=namespace)
1019 end if
1020
1021 if (.not. parameter_defined(option__species__valence)) then
1022 if (spec%is_user_defined()) then
1023 call spec%set_zval(m_zero)
1024 else
1025 call messages_input_error(namespace, 'Species', &
1026 "The 'valence' parameter is missing for species '"//trim(spec%get_label())//"'")
1027 end if
1028 end if
1029
1030 end select
1031
1032 call iihash_end(read_parameters)
1033
1034 pop_sub(read_from_block)
1035
1036 contains
1037
1038 logical function parameter_defined(param) result(defined)
1039 integer(int64), intent(in) :: param
1040
1041 integer :: tmp
1042
1044
1045 tmp = iihash_lookup(read_parameters, int(-param), defined)
1046
1048 end function parameter_defined
1049
1050 !------------------------------------------------------
1051 subroutine check_duplication(param)
1052 integer(int64), intent(in) :: param
1053
1055
1056 if (parameter_defined(param)) then
1057 call messages_input_error(namespace, 'Species', "Duplicated parameter in species '"//trim(spec%get_label())//"'")
1058 end if
1059
1060 call iihash_insert(read_parameters, int(-param), 1)
1061
1063 end subroutine check_duplication
1064
1065
1066 !------------------------------------------------------
1067 subroutine check_real_atom_species()
1068
1069 call element_init(element, get_symbol(spec%get_label()))
1070
1071 if (.not. element_valid(element)) then
1072 call messages_write('Cannot determine the element for species '//trim(spec%get_label())//'.')
1073 call messages_fatal(namespace=namespace)
1074 end if
1075
1076 call spec%set_z(real(element_atomic_number(element), real64))
1077
1078 if (spec%get_mass() < m_zero) then
1079 call spec%set_mass(element_mass(element))
1080 call messages_write('Info: default mass for species '//trim(spec%get_label())//':')
1081 call messages_write(spec%get_mass())
1082 call messages_write(' amu.')
1083 call messages_info(namespace=namespace)
1084 end if
1085
1086 if (spec%get_vdw_radius() < m_zero) then
1087 call spec%set_vdw_radius(element_vdw_radius(element))
1088 if (spec%get_vdw_radius() < m_zero) then
1089 call spec%set_vdw_radius(m_zero)
1090 call messages_write("The default vdW radius for species '"//trim(spec%get_label())//"' is not defined.", &
1091 new_line = .true.)
1092 call messages_write("You can specify the vdW radius in %Species block.")
1093 call messages_warning(namespace=namespace)
1094 end if
1095 call messages_write('Info: default vdW radius for species '//trim(spec%get_label())//':')
1096 call messages_write(spec%get_vdw_radius())
1097 call messages_write(' [b]')
1098 call messages_info(namespace=namespace)
1099 end if
1100
1101 call element_end(element)
1102
1103
1104 end subroutine check_real_atom_species
1105 end function read_from_block
1106
1107end module species_factory_oct_m
1108
1109!! Local Variables:
1110!! mode: f90
1111!! coding: utf-8
1112!! End:
subroutine check_duplication(param)
logical function parameter_defined(param)
Delete the C++ object.
Definition: pseudo_set.F90:133
Nullify the C++ pointer.
Definition: pseudo_set.F90:123
logical function, public element_valid(self)
Definition: element.F90:170
real(real64), parameter, public m_zero
Definition: global.F90:173
real(real64), parameter, public m_epsilon
Definition: global.F90:189
type(conf_t), public conf
Global instance of Octopus configuration.
Definition: global.F90:163
real(real64), parameter, public m_half
Definition: global.F90:179
real(real64), parameter, public m_one
Definition: global.F90:174
This module implements a simple hash table for non-negative integer keys and integer values.
Definition: iihash.F90:104
subroutine, public iihash_end(h)
Free a hash table.
Definition: iihash.F90:163
subroutine, public iihash_insert(h, key, val)
Insert a (key, val) pair into the hash table h.
Definition: iihash.F90:185
integer function, public iihash_lookup(h, key, found)
Look up a value in the hash table h. If found is present, it indicates if key could be found in the t...
Definition: iihash.F90:210
subroutine, public iihash_init(h)
Initialize a hash table h.
Definition: iihash.F90:140
Definition: io.F90:93
integer, parameter, public species_charge_density
user-defined function for charge density
Definition: jellium.F90:118
integer, parameter, public species_jellium_charge_density
jellium volume read from file
Definition: jellium.F90:118
integer, parameter, public species_jellium
jellium sphere.
Definition: jellium.F90:118
integer, parameter, public species_from_file
Definition: jellium.F90:118
integer, parameter, public species_usdef
user-defined function for local potential
Definition: jellium.F90:118
integer, parameter, public species_jellium_slab
jellium slab.
Definition: jellium.F90:118
subroutine, public messages_warning(no_lines, all_nodes, namespace)
Definition: messages.F90:501
subroutine, public messages_obsolete_variable(namespace, name, rep)
Definition: messages.F90:980
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
Definition: messages.F90:138
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
Definition: messages.F90:386
subroutine, public messages_input_error(namespace, var, details, row, column)
Definition: messages.F90:671
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
Definition: messages.F90:570
logical function, public parse_is_defined(namespace, name)
Definition: parser.F90:440
subroutine, public parse_block_string(blk, l, c, res, convert_to_c)
Definition: parser.F90:795
integer function, public parse_block(namespace, name, blk, check_varinfo_)
Definition: parser.F90:600
/* To use the profiling module, call profiling_in and profiling_out with the label of the region as a...
Definition: profiling.F90:122
subroutine, public pseudo_set_init(pseudo_set, dirname, ierr)
Definition: pseudo_set.F90:168
character(len=max_path_len) function, public get_set_directory(set_id)
subroutine, public read_from_set(spec, set_id, set, read_data)
Creates a pseudopotential type from a set.
integer, parameter, public species_pseudo
pseudopotential
integer, parameter, public species_pspio
pseudopotential parsed by pspio library
subroutine, public share_directory_set(dir)
class(species_t) function, pointer species_factory_create_from_input(factory, namespace, label, index)
Reads the information (from the input file) about a species_t variable, initializing part of it (it h...
subroutine, public species_factory_init(factory, namespace)
class(species_t) function, pointer read_from_block(factory, namespace, blk, row, label, index, read_data)
Parses the species block for a given species.
subroutine, public species_factory_end(factory)
character(kind=c_char) function, dimension(label_len+1), public get_symbol(label)
Definition: species.F90:500
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
Definition: unit.F90:111
This module defines the unit system, used for input and output.
type(unit_system_t), public units_inp
the units systems for reading and writing
subroutine check_real_atom_species()
An abstract class for species. Derived classes include jellium, all electron, and pseudopotential spe...
Definition: species.F90:124
int true(void)