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)
132
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)
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 pseudodojo_pbe 100
215 !% PBE version of the pseudopotentials of http://pseudo-dojo.org. Version 0.5
216 !%Option pseudodojo_lda 103
217 !% LDA pseudopotentials of http://pseudo-dojo.org. Version 0.41.
218 !%Option pseudodojo_pbesol 105
219 !% PBEsol version of the pseudopotentials of http://pseudo-dojo.org. Version 0.41.
220 !%Option pseudodojo_pbe_fr 106
221 !% Fully-relativistic PBE version of the pseudopotentials of http://pseudo-dojo.org. Version 0.4.
222 !%End
223 default_val = option__pseudopotentialset__standard
224 if(factory%default_allelectron_type /= option__allelectrontype__no) default_val = option__pseudopotentialset__none
225 call parse_variable(namespace, 'PseudopotentialSet', default_val, factory%default_pseudopotential_set_id)
226 call messages_print_var_option('PseudopotentialSet', factory%default_pseudopotential_set_id, namespace=namespace)
227 if (factory%default_pseudopotential_set_id /= option__pseudopotentialset__none) then
228 call pseudo_set_init(factory%default_pseudopotential_set, get_set_directory(factory%default_pseudopotential_set_id), ierr)
229 else
230 call pseudo_set_nullify(factory%default_pseudopotential_set)
231 end if
232
233 if (factory%default_pseudopotential_set_id /= option__pseudopotentialset__none &
234 .and. factory%default_allelectron_type /= option__allelectrontype__no) then
235 message(1) = "PseudopotentialSet /= none cannot be used with AllElectronType /= no."
236 call messages_fatal(1, namespace=namespace)
237 end if
238
239 pop_sub_with_profile(species_factory_init)
240 end subroutine species_factory_init
241
242 ! ---------------------------------------------------------
243
244 subroutine species_factory_end(factory)
245 class(species_factory_t), intent(inout) :: factory
246
247 push_sub(species_factory_end)
248
249 if (factory%initialized) then
250 call pseudo_set_end(factory%default_pseudopotential_set)
251 factory%initialized = .false.
252 end if
253
254 pop_sub(species_factory_end)
255 end subroutine species_factory_end
256
257
258 ! ---------------------------------------------------------
263 ! ---------------------------------------------------------
264 function species_factory_create_from_input(factory, namespace, label, index) result(spec)
265 class(species_factory_t), intent(in) :: factory
266 type(namespace_t), intent(in) :: namespace
267 character(len=*), intent(in) :: label
268 integer, intent(in) :: index
269 class(species_t), pointer :: spec
270
271 character(len=LABEL_LEN) :: lab
272 integer :: ib, row, n_spec_block, read_data
273 type(block_t) :: blk
274 type(element_t) :: element
275
277
278 read_data = 0
279
280 !%Variable Species
281 !%Type block
282 !%Section System::Species
283 !%Description
284 !% A species is by definition either an "ion" (nucleus + core electrons) described
285 !% through a pseudopotential, or a model potential.
286 !%
287 !% Note that some sets of pseudopotentials are distributed with
288 !% the code. To use these pseudopotentials, you do not need to define them
289 !% explicitly in the <tt>Species</tt> block, as default parameters
290 !% are provided.
291 !% You can select the set for default pseudopotentials using the
292 !% <tt>PseudopotentialSet</tt> variable.
293 !%
294 !% Supported norm-conserving pseudopotential formats are
295 !% detected by the file extension: UPF (<tt>.upf</tt>), PSF (SIESTA, <tt>.psf</tt>), FHI (ABINIT 6, <tt>.fhi</tt>),
296 !% CPI (Fritz-Haber, <tt>.cpi</tt>), QSO (quantum-simulation.org, for Qbox, <tt>.xml</tt>),
297 !% HGH (Hartwigsen-Goedecker-Hutter, <tt>.hgh</tt>).
298 !% PSPIO format can also be used via <tt>species_pspio</tt> if that library is linked.
299 !% Note: pseudopotentials may only be used in 3D.
300 !%
301 !% The format of this block is the following: The first field is a
302 !% string that defines the name of the species. The second field
303 !% defines the type of species (the valid options are detailed
304 !% below).
305 !%
306 !% Then a list of parameters follows. The parameters are specified
307 !% by a first field with the parameter name and the field that
308 !% follows with the value of the parameter. Some parameters are
309 !% specific to a certain species while others are accepted by all
310 !% species. These are <tt>mass</tt>, <tt>max_spacing</tt>, and <tt>min_radius</tt>.
311 !%
312 !% These are examples of possible species:
313 !%
314 !% <tt>%Species
315 !% <br>&nbsp;&nbsp;'O' | species_pseudo | file | 'O.psf' | lmax | 1 | lloc | 1
316 !% <br>&nbsp;&nbsp;'H' | species_pseudo | file | '../H.hgh'
317 !% <br>&nbsp;&nbsp;'Xe' | species_pseudo | set | pseudojo_pbe
318 !% <br>&nbsp;&nbsp;'C' | species_pseudo | file | "carbon.xml"
319 !% <br>&nbsp;&nbsp;'jlm' | species_jellium | jellium_radius | 5.0
320 !% <br>&nbsp;&nbsp;'rho' | species_charge_density | density_formula | "exp(-r/a)" | mass | 17.0 | valence | 6
321 !% <br>&nbsp;&nbsp;'udf' | species_user_defined | potential_formula | "1/2*r^2" | valence | 8
322 !% <br>&nbsp;&nbsp;'He_all' | species_full_delta
323 !% <br>&nbsp;&nbsp;'H_all' | species_full_gaussian | gaussian_width | 0.2
324 !% <br>&nbsp;&nbsp;'Li1D' | species_soft_coulomb | softening | 1.5 | valence | 3
325 !% <br>&nbsp;&nbsp;'H_all' | species_full_anc | anc_a | 4
326 !% <br>%</tt>
327 !%Option species_pseudo -7
328 !% The species is a pseudopotential. How to get the
329 !% pseudopotential can be specified by the <tt>file</tt> or
330 !% the <tt>set</tt> parameters. If both are missing, the
331 !% pseudopotential will be taken from the <tt>PseudopotentialSet</tt>
332 !% specified for the run, this is useful if you want to change
333 !% some parameters of the pseudo, like the <tt>mass</tt>.
334 !%
335 !% The optional parameters for this type of species are
336 !% <tt>lmax</tt>, that defines the maximum angular momentum
337 !% component to be used, and <tt>lloc</tt>, that defines the
338 !% angular momentum to be considered as local. When these
339 !% parameters are not set, the value for lmax is the maximum
340 !% angular component from the pseudopotential file. The default
341 !% value for <tt>lloc</tt> is taken from the pseudopotential if
342 !% available, if not, it is set to 0. Note that, depending on the
343 !% type of pseudopotential, it might not be possible to select
344 !% <tt>lmax</tt> and <tt>lloc</tt>, if that is the case the
345 !% parameters will be ignored.
346 !%
347 !%Option species_pspio -110
348 !% (experimental) Alternative method to read pseudopotentials
349 !% using the PSPIO library. This species uses the same parameters
350 !% as <tt>species_pseudo</tt>.
351 !%Option species_user_defined -123
352 !% Species with user-defined potential. The potential for the
353 !% species is defined by the formula given by the <tt>potential_formula</tt>
354 !% parameter.
355 !% The
356 !% <tt>valence</tt> parameter determines the number of electrons
357 !% associated with the species. By default, a valence of 0 is assumed.
358 !%Option species_charge_density -125
359 !% The potential for this species is created from the distribution
360 !% of charge given by the <tt>density_formula</tt> parameter.
361 !% The
362 !% <tt>valence</tt> parameter determines the number of electrons
363 !% associated with the species. By default, a valence of 0 is assumed.
364 !%Option species_point -3
365 !%Option species_jellium -3
366 !% Jellium sphere.
367 !% The charge associated with this species must be given by the <tt>valence</tt> parameter.
368 !%Option species_jellium_slab -4
369 !% A slab of jellium that extends across the simulation box in the
370 !% <i>xy</i>-plane. The dimension along the <i>z</i> direction is
371 !% determined by the required parameter <tt>thickness</tt>.
372 !% The charge associated with this species must be given by the <tt>valence</tt> parameter.
373 !%Option species_full_delta -127
374 !% Full atomic potential represented by a delta charge
375 !% distribution. The atom will be displaced to the nearest grid
376 !% point. The atomic number is determined from the name of the species.
377 !%Option species_full_anc -130
378 !% Analytical norm-conserving regularized Coulomb potential from
379 !% [Gygi J. Chem. Theory Comput. 2023, 19, 1300−1309].
380 !% Unlike <tt>species_full_delta</tt> and <tt>species_full_gaussian</tt>, this species has
381 !% no nuclear charge density: the potential is applied directly, without solving a Poisson
382 !% equation for the nucleus. The <tt>External</tt> and <tt>Hartree</tt> components reported
383 !% in <tt>static/info</tt> are therefore split differently than for the other two types.
384 !%Option species_full_gaussian -124
385 !% A full-potential atom is defined by a Gaussian accumulation of
386 !% positive charge, in the form:
387 !%
388 !% <math>\rho(r) = Z (\zeta/\pi)^{3/2} e^{-\zeta (\vec{r}-\vec{r_0})^2}</math>
389 !%
390 !% with <math>\zeta = 1/(2\sigma^2\delta^2)</math> in bohr<sup>-2</sup>, where
391 !% <math>\sigma</math> is set by the parameter <tt>gaussian_width</tt> and
392 !% <math>\delta</math> is the grid spacing (the grid spacing in the first dimension,
393 !% to be precise). The prefactor maintains proper normalization: the integral of
394 !% <math>\rho</math> sums up to <math>Z</math>.
395 !% <math>\vec{r_0}</math> is calculated in such a way that the
396 !% first moment of <math>\rho(r)/Z</math> is equal to the atomic
397 !% position. For a precise description, see N. A. Modine,
398 !% <i>Phys. Rev. B</i> <b>55</b>, 10289 (1997).
399 !%
400 !% The Gaussian is built in the primitive coordinates of the mesh, whose spacing is
401 !% uniform, so with curvilinear coordinates it is narrower in real space where the grid
402 !% is denser. This works with <tt>curv_gygi</tt> and <tt>curv_modine</tt>, but not with
403 !% <tt>curv_briggs</tt>, and not for periodic systems.
404 !% The atomic number is determined from the name of the species.
405 !%Option species_from_file -126
406 !% The potential is read from a file. Accepted file formats, detected by extension: obf, ncdf and csv.
407 !% The
408 !% <tt>valence</tt> parameter determines the number of electrons
409 !% associated with the species. By default, a valence of 0 is assumed.
410 !%Option species_soft_coulomb -128
411 !% The potential is a soft-Coulomb function, <i>i.e.</i> a function in the form:
412 !%
413 !% <math>v(r) = - z_{val} / \sqrt{a^2 + r^2}</math>
414 !%
415 !% The value of <i>a</i> should be given by the mandatory <tt>softening</tt> parameter.
416 !% The charge associated with this species must be given by the <tt>valence</tt> parameter.
417 !%Option species_jellium_charge_density -129
418 !% The parameter is the name of a volume block specifying the shape of the jellium.
419 !%Option lmax -10003
420 !% The maximum angular-momentum channel that will be used for the pseudopotential.
421 !%Option lloc -10004
422 !% The angular-momentum channel of the pseudopotential to be considered local.
423 !%Option mass -10005
424 !% The mass of the species in atomic mass units, <i>i.e.</i> the mass of a proton is
425 !% roughly one. It is set automatically for pseudopotentials from the
426 !% <a href=http://www.nist.gov/pml/data/comp.cfm>NIST values</a>.
427 !% For other species, the default is 1.0.
428 !%Option valence -10006
429 !% The number of electrons of the species. It is set automatically from the name of the species.
430 !% if it correspond to the name in the periodic table. If not specified and if the name
431 !% does not match an atom name, a value of 0 is assumed.
432 !%Option jellium_radius -10007
433 !% The radius of the sphere for <tt>species_jellium</tt>. If this value is not specified,
434 !% the default of 0.5 bohr is used.
435 !%Option set -10017
436 !% For a <tt>species_pseudo</tt>, get the pseudopotential from a
437 !% particular set. This flag must be followed with one of the
438 !% valid values for the variable <tt>PseudopotentialSet</tt>.
439 !%Option gaussian_width -10008
440 !% The width <math>\sigma</math> of the Gaussian (in units of the grid spacing) used to
441 !% represent the nuclear charge for <tt>species_full_gaussian</tt>. If not present, the
442 !% value of <tt>AllElectronSigma</tt> is used, which itself defaults to 0.6. See
443 !% <tt>AllElectronSigma</tt> for the consequences of tying the nuclear size to the grid.
444 !%Option softening -10009
445 !% The softening parameter <i>a</i> for <tt>species_soft_coulomb</tt> in units of length.
446 !%Option file -10010
447 !% The path for the file that describes the species.
448 !%Option db_file -10011
449 !% Obsolete. Use the <tt>set</tt> option of the <tt>PseudopotentialSet</tt> variable instead.
450 !%Option potential_formula -10012
451 !% Mathematical expression that defines the potential for <tt>species_user_defined</tt>. You can use
452 !% any of the <i>x</i>, <i>y</i>, <i>z</i> or <i>r</i> variables.
453 !%Option density_formula -10013
454 !% Mathematical expression that defines the charge density for <tt>species_charge_density</tt>. You can use
455 !% any of the <i>x</i>, <i>y</i>, <i>z</i> or <i>r</i> variables.
456 !%Option thickness -10014
457 !% The thickness of the slab for species_jellium_slab. Must be positive.
458 !%Option vdw_radius -10015
459 !% The van der Waals radius that will be used for this species.
460 !%Option volume -10016
461 !% Name of a volume block
462 !%Option hubbard_l -10018
463 !% The angular-momentum for which the effective U will be applied.
464 !%Option hubbard_u -10019
465 !% The effective U that will be used for the DFT+U calculations.
466 !%Option hubbard_j -10020
467 !% The value of j (hubbard_l-1/2 or hubbard_l+1/2) on which the effective U is applied.
468 !%Option hubbard_alpha -10021
469 !% The strength of the potential constraining the occupations of the localized subspace
470 !% as defined in PRB 71, 035105 (2005)
471 !%Option anc_a -10022
472 !% The value of the parameter a of the ANC potential, as defined in [Gygi, JCTC 2023, 19, 1300−1309].
473 !% This parameter has the unit of inverse length and determines the range of regularization.
474 !% The code scales the radius as <math>a Z r</math>, so the regularization length is
475 !% <math>1/(aZ)</math> bohr and shrinks with the atomic number. If not present, the value of
476 !% <tt>AllElectronANCParam</tt> is used, which defaults to 4, a value validated for hydrogen
477 !% only.
478 !%End
479
480 call messages_obsolete_variable(namespace, 'SpecieAllElectronSigma', 'Species')
481 call messages_obsolete_variable(namespace, 'SpeciesAllElectronSigma', 'Species')
482
483 ! First, find out if there is a Species block.
484 n_spec_block = 0
485 if (parse_block(namespace, 'Species', blk) == 0) then
486 n_spec_block = parse_block_n(blk)
487 end if
488
489 ! Find out if the sought species is in the block
490 row = -1
491 block: do ib = 1, n_spec_block
492 call parse_block_string(blk, ib-1, 0, lab)
493 if (trim(lab) == trim(label)) then
494 row = ib - 1
495 exit block
496 end if
497 end do block
498
499 ! Read whatever may be read from the block
500 if (row >= 0) then
501 spec => factory%create_from_block(namespace, blk, row, label, index, read_data)
502 call parse_block_end(blk)
503
504 assert(read_data > 0)
505
507 return
508 end if
509
510 ! We get here if there is a Species block but it does not contain
511 ! the species we are looking for.
512 if (n_spec_block > 0) call parse_block_end(blk)
513
514 ! Initialize all electron species (except soft-Coulomb) from specified allelectron type
515 if(factory%default_allelectron_type /= option__allelectrontype__no) then
516 select case(factory%default_allelectron_type)
517 case(option__allelectrontype__full_delta)
518 spec => full_delta_t(label, index, factory%default_sigma)
519 case(option__allelectrontype__full_gaussian)
520 spec => full_gaussian_t(label, index, factory%default_sigma)
521 case(option__allelectrontype__full_anc)
522 spec => full_anc_t(label, index, factory%default_anc_a)
523 case default
524 assert(.false.)
525 end select
526
527 ! get the mass, vdw radius and atomic number for this element
528 call element_init(element, get_symbol(spec%get_label()))
529
530 assert(element_valid(element))
531
532 call spec%set_z(real(element_atomic_number(element), real64))
533 call spec%set_zval(spec%get_z())
534 call spec%set_mass(element_mass(element))
535 call spec%set_vdw_radius(element_vdw_radius(element))
536
537 call element_end(element)
538
539 else ! Pseudopotential from specified set or the default one
540 spec => pseudopotential_t(label, index)
541 select type(spec)
542 type is(pseudopotential_t)
543 call read_from_set(spec, factory%default_pseudopotential_set_id, factory%default_pseudopotential_set, read_data)
544
545 if (read_data == 0) then
546 call messages_write( 'Species '//trim(spec%get_label())//' not found in default pseudopotential set.', new_line=.true. )
547 call messages_write('( '//trim(get_set_directory(factory%default_pseudopotential_set_id))//' )')
548 call messages_fatal(namespace=namespace)
549 end if
550 end select
551 end if
552
555
556!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
557! Private procedures
558
559 ! ---------------------------------------------------------
561 function read_from_block(factory, namespace, blk, row, label, index, read_data) result(spec)
562 class(species_factory_t), intent(in) :: factory
563 type(namespace_t), intent(in) :: namespace
564 type(block_t), intent(in) :: blk
565 integer, intent(in) :: row
566 character(len=*), intent(in) :: label
567 integer, intent(in) :: index
568 integer, intent(out):: read_data
569 class(species_t), pointer :: spec
570
571 integer :: ncols, icol, flag, set_read_data, ierr, type
572 type(element_t) :: element
573 type(iihash_t) :: read_parameters
574 integer :: user_lmax, user_llocal, hubbard_l, pseudopotential_set_id
575 real(real64) :: hubbard_u, hubbard_j, hubbard_alpha, mass, z_val, jradius, jthick, vdw_radius, aa
576 real(real64) :: sigma, softening
577 character(len=MAX_PATH_LEN) :: filename
578
579 integer, parameter :: &
580 species_jellium = 3, & !< jellium sphere.
583 species_pseudo = 7, &
584 species_pspio = 110, &
585 species_usdef = 123, &
586 species_full_gaussian = 124, &
587 species_charge_density = 125, &
588 species_from_file = 126, &
589 species_full_delta = 127, &
590 species_soft_coulomb = 128, &
591 species_full_anc = 130
592
593 push_sub(read_from_block)
594
595 ncols = parse_block_cols(blk, row)
596 read_data = 0
597
598 call parse_block_integer(blk, row, 1, type)
599
600 ! To detect the old species block format, options are represented
601 ! as negative values. If we get a non-negative value we know we
602 ! are reading a mass.
603 if (type >= 0) then
604 call messages_write('Found a species with the old format. Please update', new_line = .true.)
605 call messages_write('the Species block to the new format, where the second', new_line = .true.)
606 call messages_write('column indicates the type of the species.')
607 call messages_fatal(namespace=namespace)
608 end if
609
610 ! now we convert back to positive
611 type = -type
612
613 read_data = 2
614
615
616 select case (type)
617
618 case (species_soft_coulomb)
619 spec => soft_coulomb_t(label, index)
620
621 case (species_usdef) ! user-defined
622 spec => species_user_defined_t(label, index)
623
624 case (species_from_file)
625 spec => species_from_file_t(label, index)
626
627 case (species_jellium)
628 spec => jellium_sphere_t(label, index)
629
631 spec => jellium_slab_t(label, index)
632
633 case (species_full_delta)
634 spec => full_delta_t(label, index, factory%default_sigma)
635
636 case (species_full_gaussian)
637 spec => full_gaussian_t(label, index, factory%default_sigma)
638
639 case (species_full_anc)
640 spec => full_anc_t(label, index, factory%default_anc_a)
641
643 spec => species_charge_density_t(label, index)
644
646 spec => jellium_charge_t(label, index)
647
648 case (species_pseudo)
649 spec => pseudopotential_t(label, index)
650
651 case (species_pspio) ! a pseudopotential file to be handled by the pspio library
652 spec => pseudopotential_t(label, index)
653
654 case default
655 call messages_input_error(namespace, 'Species', "Unknown type for species '"//trim(spec%get_label())//"'", row=row, column=1)
656 end select
657
658 call spec%set_mass(-m_one)
659 call spec%set_vdw_radius(-m_one)
660 call spec%set_zval(-m_one)
661
662 call iihash_init(read_parameters)
663
664 icol = read_data
665 do
666 if (icol >= ncols) exit
667
668 call parse_block_integer(blk, row, icol, flag)
669
670 select case (flag)
671
672 case (option__species__lmax)
673 call check_duplication(option__species__lmax)
674 call parse_block_integer(blk, row, icol + 1, user_lmax)
675
676 select type(spec)
677 class is(pseudopotential_t)
678 call spec%set_user_lmax(user_lmax)
679 class default
680 call messages_input_error(namespace, 'Species', &
681 "The 'lmax' parameter in species "//trim(spec%get_label())//" can only be used with pseudopotential species", &
682 row=row, column=icol+1)
683 end select
684
685 if (user_lmax < 0) then
686 call messages_input_error(namespace, 'Species', &
687 "The 'lmax' parameter in species "//trim(spec%get_label())//" cannot be negative", &
688 row=row, column=icol+1)
689 end if
690
691 case (option__species__lloc)
692 call check_duplication(option__species__lloc)
693 call parse_block_integer(blk, row, icol + 1, user_llocal)
694
695 select type(spec)
696 class is(pseudopotential_t)
697 call spec%set_user_lloc(user_llocal)
698 class default
699 call messages_input_error(namespace, 'Species', &
700 "The 'lloc' parameter in species "//trim(spec%get_label())//" can only be used with pseudopotential species", &
701 row=row, column=icol+1)
702 end select
703
704 if (user_llocal < 0) then
705 call messages_input_error(namespace, 'Species', &
706 "The 'lloc' parameter in species "//trim(spec%get_label())//" cannot be negative", row=row, column=icol+1)
707 end if
708
709 case (option__species__hubbard_l)
710 call check_duplication(option__species__hubbard_l)
711 call parse_block_integer(blk, row, icol + 1, hubbard_l)
712
713 select type(spec)
714 class is(pseudopotential_t)
715 call spec%set_hubbard_l(hubbard_l)
716 class default
717 call messages_input_error(namespace, 'Species', &
718 "The 'hubbard_l' parameter in species "//trim(spec%get_label())//" can only be used with pseudopotential species", &
719 row=row, column=icol+1)
720 end select
721
722 if (hubbard_l < 0) then
723 call messages_input_error(namespace, 'Species', &
724 "The 'hubbard_l' parameter in species "//trim(spec%get_label())//" cannot be negative", row=row, column=icol+1)
725 end if
726
727 case (option__species__hubbard_u)
728 call check_duplication(option__species__hubbard_u)
729 call parse_block_float(blk, row, icol + 1, hubbard_u, unit = units_inp%energy)
730 call spec%set_hubbard_u(hubbard_u)
731
732 case (option__species__hubbard_alpha)
733 call check_duplication(option__species__hubbard_alpha)
734 call parse_block_float(blk, row, icol + 1, hubbard_alpha, unit = units_inp%energy)
735 call spec%set_hubbard_alpha(hubbard_alpha)
736
737 case (option__species__hubbard_j)
738 call check_duplication(option__species__hubbard_j)
739 call parse_block_float(blk, row, icol + 1, hubbard_j)
740 call spec%set_hubbard_j(hubbard_j)
741
742 if (abs(abs(spec%get_hubbard_j()-spec%get_hubbard_l())-m_half) <= m_epsilon) then
743 call messages_input_error(namespace, 'Species', "The 'hubbard_j' parameter in species "// &
744 trim(spec%get_label())//" can only be hubbard_l +/- 1/2", row=row, column=icol+1)
745 end if
746
747 case (option__species__mass)
748 call check_duplication(option__species__mass)
749 call parse_block_float(blk, row, icol + 1, mass, unit = units_inp%mass)
750 call spec%set_mass(mass)
751
752 case (option__species__valence)
753 call check_duplication(option__species__valence)
754 call parse_block_float(blk, row, icol + 1, z_val)
755 call spec%set_zval(z_val)
756 call spec%set_z(z_val)
757
758 case (option__species__jellium_radius)
759 call check_duplication(option__species__jellium_radius)
760 call parse_block_float(blk, row, icol + 1, jradius)
761 if (jradius <= m_zero) call messages_input_error(namespace, 'Species', 'jellium_radius must be positive', &
762 row=row, column=icol+1)
763
764 select type(spec)
765 type is(jellium_sphere_t)
766 call spec%set_radius(jradius)
767 class default
768 call messages_input_error(namespace, 'Species', 'jellium_radius can only be used with species_jellium', &
769 row=row, column=icol+1)
770 end select
771
772 case (option__species__gaussian_width)
773 call check_duplication(option__species__gaussian_width)
774 call parse_block_float(blk, row, icol + 1, sigma)
775 if (sigma <= m_zero) call messages_input_error(namespace, 'Species', 'gaussian_width must be positive', &
776 row=row, column=icol+1)
777 select type(spec)
778 type is(full_gaussian_t)
779 call spec%set_sigma(sigma)
780 class default
781 call messages_input_error(namespace, 'Species', 'gaussian_width can only be used with species_full_gaussian', &
782 row=row, column=icol+1)
783 end select
784
785 case (option__species__anc_a)
786 call check_duplication(option__species__anc_a)
787 call parse_block_float(blk, row, icol + 1, aa)
788 if (aa <= m_zero) call messages_input_error(namespace, 'Species', 'anc_a must be positive', &
789 row=row, column=icol+1)
790
791 select type(spec)
792 type is(full_anc_t)
793 call spec%set_a(aa)
794 class default
795 call messages_input_error(namespace, 'Species', 'anc_a can only be used with species_full_anc', &
796 row=row, column=icol+1)
797 end select
798
799 case (option__species__softening)
800 call check_duplication(option__species__softening)
801 call parse_block_float(blk, row, icol + 1, softening)
802 softening = softening**2
803
804 select type(spec)
805 type is(soft_coulomb_t)
806 call spec%set_softening2(softening)
807 class default
808 call messages_input_error(namespace, 'Species', 'softening can only be used with species_soft_coulomb', &
809 row=row, column=icol+1)
810 end select
811
812 case (option__species__file)
813 call check_duplication(option__species__file)
814 call parse_block_string(blk, row, icol + 1, filename)
815 call spec%set_filename(filename)
816
817 case (option__species__db_file)
818 call messages_write("The 'db_file' option for 'Species' block is obsolete. Please use", new_line = .true.)
819 call messages_write("the option 'set' or the variable 'PseudopotentialSet' instead.")
820 call messages_fatal(namespace=namespace)
821
822 case (option__species__set)
823 call check_duplication(option__species__set)
824 call parse_block_integer(blk, row, icol + 1, pseudopotential_set_id)
825
826 select type(spec)
827 type is(pseudopotential_t)
828 spec%pseudopotential_set_initialized = .true.
829 spec%pseudopotential_set_id = pseudopotential_set_id
830 call pseudo_set_init(spec%pseudopotential_set, get_set_directory(spec%pseudopotential_set_id), ierr)
831 class default
832 call messages_input_error(namespace, 'Species', 'set can only be used with species_pseudo', &
833 row=row, column=icol+1)
834 end select
835
836 case (option__species__potential_formula)
837 call check_duplication(option__species__potential_formula)
838 select type(spec)
840 call parse_block_string(blk, row, icol + 1, spec%potential_formula, convert_to_c=.true.)
841 class default
842 call messages_input_error(namespace, 'Species', 'potential_formula can only be used with species_user_defined', &
843 row=row, column=icol+1)
844 end select
845
846 case (option__species__volume)
847 call check_duplication(option__species__volume)
848
849 select type(spec)
850 type is(jellium_charge_t)
851 call parse_block_string(blk, row, icol + 1, spec%density_formula, convert_to_c=.true.)
852
853 class default
854 call messages_input_error(namespace, 'Species', 'volume can only be used with species_jellium_charge_density', &
855 row=row, column=icol+1)
856 end select
857
858 case (option__species__density_formula)
859 call check_duplication(option__species__density_formula)
860
861 select type(spec)
863 call parse_block_string(blk, row, icol + 1, spec%density_formula, convert_to_c=.true.)
864
865 class default
866 call messages_input_error(namespace, 'Species', 'density_formula can only be used with species_charge_density', &
867 row=row, column=icol+1)
868 end select
869
870 case (option__species__thickness)
871 call check_duplication(option__species__thickness)
872 call parse_block_float(blk, row, icol + 1, jthick) ! thickness of the jellium slab
873
874 if (jthick <= m_zero) then
875 call messages_input_error(namespace, 'Species', 'the value of the thickness parameter in species '&
876 //trim(spec%get_label())//' must be positive.', row=row, column=icol+1)
877 end if
878
879 select type(spec)
880 type is(jellium_slab_t)
881 call spec%set_thickness(jthick)
882 class default
883 call messages_input_error(namespace, 'Species', 'thickness can only be used with species_jellium_slab', &
884 row=row, column=icol+1)
885 end select
886
887 case (option__species__vdw_radius)
888 call check_duplication(option__species__vdw_radius)
889 call parse_block_float(blk, row, icol + 1, vdw_radius, unit = units_inp%length)
890 call spec%set_vdw_radius(vdw_radius)
891
892 case default
893 call messages_input_error(namespace, 'Species', "Unknown parameter in species '"//trim(spec%get_label())//"'", &
894 row=row, column=icol)
895
896 end select
897
898 icol = icol + 2
899 end do
900 ! CHECK THAT WHAT WE PARSED MAKES SENSE
901
902 select type(spec)
903 type is(soft_coulomb_t)
904 if (.not. parameter_defined(option__species__softening)) then
905 call messages_input_error(namespace, 'Species', &
906 "The 'softening' parameter is missing for species "//trim(spec%get_label()))
907 end if
908
910 if (.not. parameter_defined(option__species__potential_formula)) then
911 call messages_input_error(namespace, 'Species', &
912 "The 'potential_formula' parameter is missing for species '"//trim(spec%get_label())//"'")
913 end if
914
916 if (.not. parameter_defined(option__species__density_formula)) then
917 call messages_input_error(namespace, 'Species', &
918 "The 'density_formula' parameter is missing for species '"//trim(spec%get_label())//"'")
919 end if
920
921 type is(species_from_file_t)
922 if( .not. (parameter_defined(option__species__file) .or. parameter_defined(option__species__db_file))) then
923 call messages_input_error(namespace, 'Species', &
924 "The 'file' or 'db_file' parameter is missing for species '"//trim(spec%get_label())//"'")
925 end if
926
927 type is(jellium_slab_t)
928 if (.not. parameter_defined(option__species__thickness)) then
929 call messages_input_error(namespace, 'Species', &
930 "The 'thickness' parameter is missing for species '"//trim(spec%get_label())//"'")
931 end if
932
933 type is(jellium_charge_t)
934 if (.not. parameter_defined(option__species__volume)) then
935 call messages_input_error(namespace, 'Species', &
936 "The 'volume' parameter is missing for species '"//trim(spec%get_label())//"'")
937 end if
938
939 type is(pseudopotential_t)
940 if (parameter_defined(option__species__lmax) .and. parameter_defined(option__species__lloc)) then
941 if (spec%get_user_lloc() > spec%get_user_lmax()) then
942 call messages_input_error(namespace, 'Species', &
943 "the 'lloc' parameter cannot be larger than the 'lmax' parameter in species "//trim(spec%get_label()))
944 end if
945 end if
946
947 if(.not. (parameter_defined(option__species__file) .or. parameter_defined(option__species__db_file))) then
948 ! we need to read the species from the pseudopotential set
949
950 !if the set was not defined, use the default set
951 if (.not. parameter_defined(option__species__set)) then
952 spec%pseudopotential_set_id = factory%default_pseudopotential_set_id
953 spec%pseudopotential_set = factory%default_pseudopotential_set
954 end if
955
956 call read_from_set(spec, spec%pseudopotential_set_id, spec%pseudopotential_set, set_read_data)
957
958 if (set_read_data == 0) then
959 call messages_write('Species '//trim(spec%get_label())//' is not defined in the requested pseudopotential set.', &
960 new_line=.true.)
961 call messages_write('( '//trim(get_set_directory(spec%pseudopotential_set_id))//' )')
962 call messages_fatal(namespace=namespace)
963 end if
964 end if
965
966 end select
967
968 select type (spec)
969 class is(pseudopotential_t)
971
972 class is(full_anc_t)
974
975 ! If z_val was not specified, we set it to be z
976 if (spec%get_zval() < m_zero) then
977 call spec%set_zval(spec%get_z())
978 end if
979
980 class is(full_gaussian_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_delta_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 default
997 if (.not. parameter_defined(option__species__mass)) then
998 call spec%set_mass(m_one)
999 call messages_write('Info: default mass for species '//trim(spec%get_label())//':')
1000 call messages_write(spec%get_mass())
1001 call messages_write(' amu.')
1002 call messages_info(namespace=namespace)
1003 end if
1004
1005 if (.not. parameter_defined(option__species__vdw_radius)) then
1006 call spec%set_vdw_radius(m_zero)
1007 call messages_write('Info: default vdW radius for species '//trim(spec%get_label())//':')
1008 call messages_write(spec%get_vdw_radius())
1009 call messages_write(' [b]')
1010 call messages_info(namespace=namespace)
1011 end if
1012
1013 if (.not. parameter_defined(option__species__valence)) then
1014 if (spec%is_user_defined()) then
1015 call spec%set_zval(m_zero)
1016 else
1017 call messages_input_error(namespace, 'Species', &
1018 "The 'valence' parameter is missing for species '"//trim(spec%get_label())//"'")
1019 end if
1020 end if
1021
1022 end select
1023
1024 call iihash_end(read_parameters)
1025
1026 pop_sub(read_from_block)
1027
1028 contains
1029
1030 logical function parameter_defined(param) result(defined)
1031 integer(int64), intent(in) :: param
1032
1033 integer :: tmp
1034
1036
1037 tmp = iihash_lookup(read_parameters, int(-param), defined)
1038
1040 end function parameter_defined
1041
1042 !------------------------------------------------------
1043 subroutine check_duplication(param)
1044 integer(int64), intent(in) :: param
1045
1047
1048 if (parameter_defined(param)) then
1049 call messages_input_error(namespace, 'Species', "Duplicated parameter in species '"//trim(spec%get_label())//"'")
1050 end if
1051
1052 call iihash_insert(read_parameters, int(-param), 1)
1053
1055 end subroutine check_duplication
1056
1057
1058 !------------------------------------------------------
1059 subroutine check_real_atom_species()
1060
1061 call element_init(element, get_symbol(spec%get_label()))
1062
1063 if (.not. element_valid(element)) then
1064 call messages_write('Cannot determine the element for species '//trim(spec%get_label())//'.')
1065 call messages_fatal(namespace=namespace)
1066 end if
1067
1068 call spec%set_z(real(element_atomic_number(element), real64))
1069
1070 if (spec%get_mass() < m_zero) then
1071 call spec%set_mass(element_mass(element))
1072 call messages_write('Info: default mass for species '//trim(spec%get_label())//':')
1073 call messages_write(spec%get_mass())
1074 call messages_write(' amu.')
1075 call messages_info(namespace=namespace)
1076 end if
1077
1078 if (spec%get_vdw_radius() < m_zero) then
1079 call spec%set_vdw_radius(element_vdw_radius(element))
1080 if (spec%get_vdw_radius() < m_zero) then
1081 call spec%set_vdw_radius(m_zero)
1082 call messages_write("The default vdW radius for species '"//trim(spec%get_label())//"' is not defined.", &
1083 new_line = .true.)
1084 call messages_write("You can specify the vdW radius in %Species block.")
1085 call messages_warning(namespace=namespace)
1086 end if
1087 call messages_write('Info: default vdW radius for species '//trim(spec%get_label())//':')
1088 call messages_write(spec%get_vdw_radius())
1089 call messages_write(' [b]')
1090 call messages_info(namespace=namespace)
1091 end if
1092
1093 call element_end(element)
1094
1095
1096 end subroutine check_real_atom_species
1097 end function read_from_block
1098
1099end module species_factory_oct_m
1100
1101!! Local Variables:
1102!! mode: f90
1103!! coding: utf-8
1104!! End:
subroutine check_duplication(param)
logical function parameter_defined(param)
Delete the C++ object.
Definition: pseudo_set.F90:156
Nullify the C++ pointer.
Definition: pseudo_set.F90:146
logical function, public element_valid(self)
Definition: element.F90:193
real(real64), parameter, public m_zero
Definition: global.F90:200
real(real64), parameter, public m_epsilon
Definition: global.F90:216
type(conf_t), public conf
Global instance of Octopus configuration.
Definition: global.F90:190
real(real64), parameter, public m_half
Definition: global.F90:206
real(real64), parameter, public m_one
Definition: global.F90:201
This module implements a simple hash table for non-negative integer keys and integer values.
Definition: iihash.F90:127
subroutine, public iihash_end(h)
Free a hash table.
Definition: iihash.F90:186
subroutine, public iihash_insert(h, key, val)
Insert a (key, val) pair into the hash table h.
Definition: iihash.F90:208
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:233
subroutine, public iihash_init(h)
Initialize a hash table h.
Definition: iihash.F90:163
Definition: io.F90:116
integer, parameter, public species_charge_density
user-defined function for charge density
Definition: jellium.F90:141
integer, parameter, public species_jellium_charge_density
jellium volume read from file
Definition: jellium.F90:141
integer, parameter, public species_jellium
jellium sphere.
Definition: jellium.F90:141
integer, parameter, public species_from_file
Definition: jellium.F90:141
integer, parameter, public species_usdef
user-defined function for local potential
Definition: jellium.F90:141
integer, parameter, public species_jellium_slab
jellium slab.
Definition: jellium.F90:141
subroutine, public messages_warning(no_lines, all_nodes, namespace)
Definition: messages.F90:525
subroutine, public messages_obsolete_variable(namespace, name, rep)
Definition: messages.F90:1000
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
Definition: messages.F90:162
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
Definition: messages.F90:410
subroutine, public messages_input_error(namespace, var, details, row, column)
Definition: messages.F90:691
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
Definition: messages.F90:594
logical function, public parse_is_defined(namespace, name)
Definition: parser.F90:463
subroutine, public parse_block_string(blk, l, c, res, convert_to_c)
Definition: parser.F90:818
integer function, public parse_block(namespace, name, blk, check_varinfo_)
Definition: parser.F90:623
subroutine, public pseudo_set_init(pseudo_set, dirname, ierr)
Definition: pseudo_set.F90:191
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:522
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
Definition: unit.F90:134
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:147
int true(void)