15 atom_basis_type, atom_integrals, atom_optimization_type, atom_orbitals, atom_p_type, &
36 #include "./base/base_uses.f90"
42 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'atom_basis'
53 TYPE(section_vals_type),
POINTER :: atom_section
55 CHARACTER(len=*),
PARAMETER :: routinen =
'atom_basis_opt'
57 CHARACTER(LEN=2) :: elem
58 CHARACTER(LEN=default_string_length), &
59 DIMENSION(:),
POINTER :: tmpstringlist
60 INTEGER :: do_eric, do_erie, handle, i, im, in, &
61 iunit, iw, k, maxl, mb, method, mo, &
62 n_meth, n_rep, nr_gh, reltyp, zcore, &
64 INTEGER,
DIMENSION(0:lmat) :: maxn
65 INTEGER,
DIMENSION(:),
POINTER :: cn
66 LOGICAL :: do_gh, eri_c, eri_e, had_ae, had_pp, &
68 REAL(kind=
dp),
DIMENSION(0:lmat, 10) :: pocc
69 TYPE(atom_basis_type),
POINTER :: ae_basis, pp_basis
70 TYPE(atom_integrals),
POINTER :: ae_int, pp_int
71 TYPE(atom_optimization_type) :: optimization
72 TYPE(atom_orbitals),
POINTER :: orbitals
73 TYPE(atom_p_type),
DIMENSION(:, :),
POINTER :: atom_info
74 TYPE(atom_potential_type),
POINTER :: ae_pot, p_pot
75 TYPE(atom_state),
POINTER :: state
76 TYPE(cp_logger_type),
POINTER :: logger
77 TYPE(section_vals_type),
POINTER :: basis_section, method_section, &
78 opt_section, potential_section, &
79 powell_section, xc_section
81 CALL timeset(routinen, handle)
88 IF (
ptable(i)%symbol == elem)
THEN
93 IF (zz /= 1) zval = zz
96 ALLOCATE (ae_basis, pp_basis)
98 NULLIFY (ae_basis%grid)
100 NULLIFY (pp_basis%grid)
107 IF (iw > 0)
CALL atom_print_info(zval,
"Atomic Basis Optimization", iw)
111 NULLIFY (potential_section)
113 ALLOCATE (ae_pot, p_pot)
131 DO in = 1, min(
SIZE(cn), 4)
132 maxn(in - 1) = cn(in)
135 maxn(in) = min(maxn(in), ae_basis%nbas(in))
136 maxn(in) = min(maxn(in), pp_basis%nbas(in))
153 ALLOCATE (ae_int, pp_int)
155 ALLOCATE (atom_info(n_rep, n_meth))
160 NULLIFY (atom_info(in, im)%atom)
163 atom_info(in, im)%atom%optimization = optimization
165 atom_info(in, im)%atom%z = zval
167 atom_info(in, im)%atom%xc_section => xc_section
173 c_vals=tmpstringlist)
181 state%maxl_calc = max(maxl, state%maxl_occ)
182 state%maxl_calc = min(
lmat, state%maxl_calc)
184 DO k = 0, state%maxl_calc
185 state%maxn_calc(k) = max(maxn(k), state%maxn_occ(k))
189 pp_calc = any(index(tmpstringlist(1:),
"CORE") /= 0)
194 zcore = zval - nint(sum(state%core))
195 CALL set_atom(atom_info(in, im)%atom, zcore=zcore, pp_calc=.true.)
197 CALL set_atom(atom_info(in, im)%atom, basis=pp_basis, potential=p_pot)
198 state%maxn_calc(:) = min(state%maxn_calc(:), pp_basis%nbas(:))
199 cpassert(all(state%maxn_calc(:) >= state%maxn_occ))
202 CALL set_atom(atom_info(in, im)%atom, zcore=zval, pp_calc=.false.)
204 CALL set_atom(atom_info(in, im)%atom, basis=ae_basis, potential=ae_pot)
205 state%maxn_calc(:) = min(state%maxn_calc(:), ae_basis%nbas(:))
206 cpassert(all(state%maxn_calc(:) >= state%maxn_occ))
211 CALL set_atom(atom_info(in, im)%atom, method_type=method, relativistic=reltyp)
212 CALL set_atom(atom_info(in, im)%atom, state=state)
213 CALL set_atom(atom_info(in, im)%atom, coulomb_integral_type=do_eric, &
214 exchange_integral_type=do_erie)
215 atom_info(in, im)%atom%hfx_pot%do_gh = do_gh
216 atom_info(in, im)%atom%hfx_pot%nr_gh = nr_gh
230 cpabort(
"METHOD_TYPE and MULTIPLICITY are incompatible")
234 mo = maxval(state%maxn_calc)
235 mb = maxval(atom_info(in, im)%atom%basis%nbas)
237 CALL set_atom(atom_info(in, im)%atom, orbitals=orbitals)
248 CALL atom_fit_basis(atom_info, ae_basis, pp_calc, iunit, powell_section)
252 CALL atom_fit_basis(atom_info, pp_basis, pp_calc, iunit, powell_section)
274 DEALLOCATE (atom_info)
276 DEALLOCATE (ae_pot, p_pot, ae_basis, pp_basis, ae_int, pp_int)
278 CALL timestop(handle)
subroutine, public atom_basis_opt(atom_section)
Optimize the atomic basis set.
routines that fit parameters for /from atomic calculations
subroutine, public atom_fit_basis(atom_info, basis, pptype, iunit, powell_section)
...
Routines that print various information about an atomic kind.
subroutine, public atom_print_basis(atom_basis, iw, title)
Print atomic basis set.
subroutine, public atom_print_method(atom, iw)
Print information about the electronic structure method in use.
subroutine, public atom_print_potential(potential, iw)
Print information about the pseudo-potential.
subroutine, public atom_print_info(zval, info, iw)
Print an information string related to the atomic kind.
Define the atom type and its sub types.
subroutine, public read_atom_opt_section(optimization, opt_section)
...
subroutine, public create_atom_type(atom)
...
subroutine, public release_atom_type(atom)
...
subroutine, public release_atom_potential(potential)
...
subroutine, public init_atom_basis(basis, basis_section, zval, btyp)
Initialize the basis for the atomic code.
integer, parameter, public lmat
subroutine, public set_atom(atom, basis, state, integrals, orbitals, potential, zcore, pp_calc, do_zmp, doread, read_vxc, method_type, relativistic, coulomb_integral_type, exchange_integral_type, fmat)
...
subroutine, public init_atom_potential(potential, potential_section, zval)
...
subroutine, public release_atom_basis(basis)
...
subroutine, public create_atom_orbs(orbs, mbas, mo)
...
Some basic routines for atomic calculations.
pure logical function, public atom_consistent_method(method, multiplicity)
Check that the atomic multiplicity is consistent with the electronic structure method.
pure integer function, dimension(0:lmat), public get_maxn_occ(occupation)
Return the maximum principal quantum number of occupied orbitals.
subroutine, public atom_set_occupation(ostring, occupation, wfnocc, multiplicity)
Set occupation of atomic orbitals.
pure integer function, public get_maxl_occ(occupation)
Return the maximum orbital quantum number of occupied orbitals.
various routines to log and control the output. The idea is that decisions about where to log should ...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
Periodic Table related data definitions.
type(atom), dimension(0:nelem), public ptable
integer, parameter, public nelem