20 #include "./base/base_uses.f90"
26 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'atomic_charges'
49 TYPE(particle_type),
DIMENSION(:),
INTENT(IN) :: particle_set
50 TYPE(qs_kind_type),
DIMENSION(:),
INTENT(IN) :: qs_kind_set
51 INTEGER,
INTENT(IN) :: scr
52 CHARACTER(LEN=*),
INTENT(IN) :: title
53 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN), &
54 OPTIONAL :: electronic_charges
57 CHARACTER(len=*),
PARAMETER :: routinen =
'print_atomic_charges'
59 CHARACTER(LEN=2) :: element_symbol
60 INTEGER :: handle, iatom, ikind, natom, nspin
61 REAL(kind=
dp) :: total_charge, zeff
63 CALL timeset(routinen, handle)
65 IF (
PRESENT(electronic_charges))
THEN
66 nspin =
SIZE(electronic_charges, 2)
67 natom =
SIZE(electronic_charges, 1)
75 IF (
SIZE(particle_set) /= natom)
THEN
76 cpabort(
"Unexpected number of atoms/charges")
78 WRITE (scr,
'(T2,A)') title
81 IF (title ==
"RESP charges:")
THEN
82 WRITE (scr,
'(A)')
" Type | Atom | Charge"
84 WRITE (scr,
'(A)')
" Atom | Charge"
87 WRITE (scr,
'(A)')
" Atom | Charge | Spin diff charge"
93 element_symbol=element_symbol, kind_number=ikind)
98 IF (title ==
"RESP charges:")
THEN
99 WRITE (scr,
'(T3,A4,2X,I6,A2,A2,F12.6)')
"RESP", iatom,
" ", element_symbol,
atomic_charges(iatom)
102 WRITE (scr,
'(I6,A2,A2,F12.6)') iatom,
" ", element_symbol,
atomic_charges(iatom)
106 WRITE (scr,
'(I6,A2,A2,F12.6)') iatom,
" ", element_symbol, zeff - electronic_charges(iatom, 1)
107 total_charge = total_charge + zeff - electronic_charges(iatom, 1)
109 WRITE (scr,
'(I6,A2,A2,2F12.6)') iatom,
" ", element_symbol, &
110 zeff - (electronic_charges(iatom, 1) + electronic_charges(iatom, 2)), &
111 (electronic_charges(iatom, 1) - electronic_charges(iatom, 2))
112 total_charge = total_charge + zeff - (electronic_charges(iatom, 1) + electronic_charges(iatom, 2))
115 IF (title ==
"RESP charges:")
THEN
116 WRITE (scr,
'(A,F10.6)')
" Total ", total_charge
118 WRITE (scr,
'(A,F10.6)')
" Total ", total_charge
120 WRITE (scr,
'(A)')
""
123 CALL timestop(handle)
136 SUBROUTINE print_multipoles(particle_set, qs_kind_set, scr, charge, dipole, quadrupole)
138 TYPE(particle_type),
DIMENSION(:),
INTENT(IN) :: particle_set
139 TYPE(qs_kind_type),
DIMENSION(:),
INTENT(IN) :: qs_kind_set
140 INTEGER,
INTENT(IN) :: scr
141 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN),
OPTIONAL :: charge
142 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN), &
144 REAL(kind=
dp),
DIMENSION(:, :, :),
INTENT(IN), &
145 OPTIONAL :: quadrupole
147 CHARACTER(len=*),
PARAMETER :: routinen =
'print_multipoles'
149 CHARACTER(LEN=2) :: element_symbol
150 INTEGER :: handle, i, iatom, ikind, natom
151 REAL(kind=
dp) :: zeff
153 CALL timeset(routinen, handle)
156 IF (
PRESENT(charge))
THEN
162 WRITE (scr,
'(T2,A)')
'multipoles:'
166 element_symbol=element_symbol, kind_number=ikind)
169 WRITE (scr,
'(a,i5)')
' iatom= ', iatom
170 WRITE (scr,
'(a,a2)')
' element_symbol= ', element_symbol
171 WRITE (scr,
'(a,f20.10)')
' zeff= ', zeff
173 WRITE (scr,
'(a, f20.10)')
'charge = ', charge(iatom)
174 WRITE (scr,
'(a,3f20.10)')
'dipole = ', dipole(:, iatom)
175 WRITE (scr,
'(a)')
'quadrupole = '
177 WRITE (scr,
'(3f20.10)') quadrupole(i, :, iatom)
181 WRITE (scr,
'(A)')
""
184 CALL timestop(handle)
186 END SUBROUTINE print_multipoles
198 TYPE(particle_type),
DIMENSION(:),
INTENT(IN) :: particle_set
199 INTEGER,
INTENT(IN) :: scr
200 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN) :: bond_orders
202 CHARACTER(LEN=2) :: el1, el2
203 INTEGER :: iatom, jatom, natom
206 natom =
SIZE(bond_orders, 1)
207 IF (
SIZE(particle_set) /= natom)
THEN
208 cpabort(
"Unexpected number of atoms/charges")
210 WRITE (scr,
'(/,T2,A)')
"Mayer Bond Orders"
211 WRITE (scr,
'(T2,A,T20,A,T40,A)')
" Type Atom 1 ",
" Type Atom 2 ",
" Bond Order "
213 CALL get_atomic_kind(atomic_kind=particle_set(iatom)%atomic_kind, element_symbol=el1)
214 DO jatom = iatom + 1, natom
215 CALL get_atomic_kind(atomic_kind=particle_set(jatom)%atomic_kind, element_symbol=el2)
216 IF (bond_orders(iatom, jatom) > 0.1_dp)
THEN
217 WRITE (scr,
'(T6,A2,I6,T24,A2,I6,T40,F12.6)') el1, iatom, el2, jatom, bond_orders(iatom, jatom)
simple routine to print charges for all atomic charge methods (currently mulliken,...
subroutine, public print_bond_orders(particle_set, scr, bond_orders)
Print Mayer bond orders.
subroutine, public print_atomic_charges(particle_set, qs_kind_set, scr, title, electronic_charges, atomic_charges)
generates a unified output format for atomic charges
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind(atomic_kind, fist_potential, element_symbol, name, mass, kind_number, natom, atom_list, rcov, rvdw, z, qeff, apol, cpol, mm_radius, shell, shell_active, damping)
Get attributes of an atomic kind.
Defines the basic variable types.
integer, parameter, public dp
Define the data structure for the particle information.
Define the quickstep kind type and their sub types.
subroutine, public get_qs_kind(qs_kind, basis_set, basis_type, ncgf, nsgf, all_potential, tnadd_potential, gth_potential, sgp_potential, upf_potential, se_parameter, dftb_parameter, xtb_parameter, dftb3_param, zeff, elec_conf, mao, lmax_dftb, alpha_core_charge, ccore_charge, core_charge, core_charge_radius, paw_proj_set, paw_atom, hard_radius, hard0_radius, max_rad_local, covalent_radius, vdw_radius, gpw_r3d_rs_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, ngrid_ang, ngrid_rad, lmax_rho0, dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, u_minus_j, U_of_dft_plus_u, J_of_dft_plus_u, alpha_of_dft_plus_u, beta_of_dft_plus_u, J0_of_dft_plus_u, occupation_of_dft_plus_u, dispersion, bs_occupation, magnetization, no_optimize, addel, laddel, naddel, orbitals, max_scf, eps_scf, smear, u_ramping, u_minus_j_target, eps_u_ramping, init_u_ramping_each_scf, reltmat, ghost, floating, name, element_symbol, pao_basis_size, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.