58#include "./base/base_uses.f90"
63 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'se_core_core'
64 LOGICAL,
PARAMETER,
PRIVATE :: debug_this_module = .false.
81 LOGICAL,
INTENT(in) :: calculate_forces
83 CHARACTER(len=*),
PARAMETER :: routinen =
'se_core_core_interaction'
85 INTEGER :: atom_a, atom_b, handle, iab, iatom, &
86 ikind, itype, jatom, jkind, nkind
87 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: atom_of_kind
88 LOGICAL :: anag, atener, defined, use_virial
89 LOGICAL,
ALLOCATABLE,
DIMENSION(:) :: se_defined
90 REAL(kind=
dp) :: delta, dr1, dr3inv(3), enuc, enucij, &
91 enuclear, r2inv, r3inv, rinv
92 REAL(kind=
dp),
DIMENSION(3) :: force_ab, rij
100 DIMENSION(:),
POINTER :: nl_iterator
106 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
115 NULLIFY (dft_control, cell, force, particle_set, se_control, se_taper, atomic_kind_set, &
118 CALL timeset(routinen, handle)
119 cpassert(
ASSOCIATED(qs_env))
120 CALL get_qs_env(qs_env=qs_env, dft_control=dft_control, cell=cell, se_taper=se_taper, &
121 virial=virial, atprop=atprop, energy=energy)
125 se_control => dft_control%qs_control%se_control
126 anag = se_control%analytical_gradients
127 use_virial = virial%pv_availability .AND. (.NOT. virial%pv_numer)
129 do_ewald_gks=se_control%do_ewald_gks, integral_screening=se_control%integral_screening, &
130 shortrange=(se_control%do_ewald .OR. se_control%do_ewald_gks), &
131 max_multipole=se_control%max_multipole, pc_coulomb_int=.false.)
134 atener = atprop%energy
136 CALL get_qs_env(qs_env=qs_env, particle_set=particle_set)
141 IF (se_control%do_ewald_gks)
THEN
142 CALL get_qs_env(qs_env=qs_env, ewald_env=ewald_env, ewald_pw=ewald_pw)
143 CALL ewald_env_get(ewald_env, alpha=se_int_control%ewald_gks%alpha)
144 CALL ewald_pw_get(ewald_pw, pw_big_pool=se_int_control%ewald_gks%pw_pool, &
145 dg=se_int_control%ewald_gks%dg)
147 cpassert(.NOT. use_virial)
150 CALL get_qs_env(qs_env=qs_env, sab_se=sab_se, atomic_kind_set=atomic_kind_set, &
151 qs_kind_set=qs_kind_set)
153 nkind =
SIZE(atomic_kind_set)
155 IF (calculate_forces)
THEN
156 CALL get_qs_env(qs_env=qs_env, particle_set=particle_set, force=force)
157 delta = se_control%delta
161 itype =
get_se_type(dft_control%qs_control%method_id)
163 ALLOCATE (se_kind_param(nkind), se_defined(nkind))
165 CALL get_qs_kind(qs_kind_set(ikind), se_parameter=se_kind_a)
166 se_kind_param(ikind)%se_param => se_kind_a
168 se_defined(ikind) = defined
172 CALL get_iterator_info(nl_iterator, ikind=ikind, jkind=jkind, iatom=iatom, jatom=jatom, r=rij)
173 IF (.NOT. se_defined(ikind)) cycle
174 IF (.NOT. se_defined(jkind)) cycle
175 se_kind_a => se_kind_param(ikind)%se_param
176 se_kind_b => se_kind_param(jkind)%se_param
177 iab = ikind + nkind*(jkind - 1)
178 dr1 = dot_product(rij, rij)
181 SELECT CASE (dft_control%qs_control%method_id)
186 CALL corecore(se_kind_a, se_kind_b, rij, enuc=enuc, itype=itype, anag=anag, &
187 se_int_control=se_int_control, se_taper=se_taper)
188 enucij = enucij + enuc
190 IF (se_int_control%do_ewald_r3)
THEN
195 enucij = enucij + se_kind_a%expns3_int(jkind)%expns3%core_core*r3inv
199 IF (calculate_forces)
THEN
200 atom_a = atom_of_kind(iatom)
201 atom_b = atom_of_kind(jatom)
203 CALL dcorecore(se_kind_a, se_kind_b, rij, denuc=force_ab, itype=itype, delta=delta, &
204 anag=anag, se_int_control=se_int_control, se_taper=se_taper)
207 IF (se_int_control%do_ewald_r3)
THEN
208 dr3inv = -3.0_dp*rij*r3inv*r2inv
210 force_ab = force_ab + se_kind_a%expns3_int(jkind)%expns3%core_core*dr3inv
217 force(ikind)%all_potential(1, atom_a) = force(ikind)%all_potential(1, atom_a) - force_ab(1)
218 force(jkind)%all_potential(1, atom_b) = force(jkind)%all_potential(1, atom_b) + force_ab(1)
220 force(ikind)%all_potential(2, atom_a) = force(ikind)%all_potential(2, atom_a) - force_ab(2)
221 force(jkind)%all_potential(2, atom_b) = force(jkind)%all_potential(2, atom_b) + force_ab(2)
223 force(ikind)%all_potential(3, atom_a) = force(ikind)%all_potential(3, atom_a) - force_ab(3)
224 force(jkind)%all_potential(3, atom_b) = force(jkind)%all_potential(3, atom_b) + force_ab(3)
230 IF (se_int_control%do_ewald_gks)
THEN
232 CALL corecore(se_kind_a, se_kind_b, rij, enuc=enuc, itype=itype, anag=anag, &
233 se_int_control=se_int_control, se_taper=se_taper)
234 enucij = enucij + 0.5_dp*enuc
238 atprop%atecc(iatom) = atprop%atecc(iatom) + 0.5_dp*enucij
239 atprop%atecc(jatom) = atprop%atecc(jatom) + 0.5_dp*enucij
241 enuclear = enuclear + enucij
245 DEALLOCATE (se_kind_param, se_defined)
247 IF (calculate_forces)
THEN
248 DEALLOCATE (atom_of_kind)
251 CALL para_env%sum(enuclear)
252 energy%core_overlap = enuclear
253 energy%core_overlap0 = enuclear
256 CALL timestop(handle)
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind_set(atomic_kind_set, atom_of_kind, kind_of, natom_of_kind, maxatom, natom, nshell, fist_potential_present, shell_present, shell_adiabatic, shell_check_distance, damping_present)
Get attributes of an atomic kind set.
Holds information on atomic properties.
subroutine, public atprop_array_init(atarray, natom)
...
Handles all functions related to the CELL.
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public ewald_env_get(ewald_env, ewald_type, alpha, eps_pol, epsilon, gmax, ns_max, o_spline, group, para_env, poisson_section, precs, rcut, do_multipoles, max_multipole, do_ipol, max_ipol_iter, interaction_cutoffs, cell_hmat)
Purpose: Get the EWALD environment.
subroutine, public ewald_pw_get(ewald_pw, pw_big_pool, pw_small_pool, rs_desc, poisson_env, dg)
get the ewald_pw environment to the correct program.
Defines the basic variable types.
integer, parameter, public dp
Interface to the message passing library MPI.
Define the data structure for the particle information.
subroutine, public get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, cell_ref, use_ref_cell, kpoints, dft_control, mos, sab_orb, sab_all, qmmm, qmmm_periodic, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, ecoul_1c, rho0_s_rs, rho0_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, harris_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, wanniercentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs)
Get the QUICKSTEP environment.
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, zatom, 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_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_model_file, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.
Define the neighbor list data types and the corresponding functionality.
subroutine, public neighbor_list_iterator_create(iterator_set, nl, search, nthread)
Neighbor list iterator functions.
subroutine, public neighbor_list_iterator_release(iterator_set)
...
integer function, public neighbor_list_iterate(iterator_set, mepos)
...
subroutine, public get_iterator_info(iterator_set, mepos, ikind, jkind, nkind, ilist, nlist, inode, nnode, iatom, jatom, r, cell)
...
Split and build its own idependent core_core SE interaction module.
subroutine, public se_core_core_interaction(qs_env, para_env, calculate_forces)
Evaluates the core-core interactions for NDDO methods.
Arrays of parameters used in the semi-empirical calculations \References Everywhere in this module TC...
real(kind=dp), parameter, public rij_threshold
Set of wrappers for semi-empirical analytical/numerical Integrals routines.
subroutine, public dcorecore(sepi, sepj, rij, denuc, itype, delta, anag, se_int_control, se_taper)
wrapper for numerical/analytical routines
subroutine, public corecore(sepi, sepj, rij, enuc, itype, anag, se_int_control, se_taper)
wrapper for numerical/analytical routines core-core integrals, since are evaluated only once do not n...
Definition of the semi empirical parameter types.
subroutine, public setup_se_int_control_type(se_int_control, shortrange, do_ewald_r3, do_ewald_gks, integral_screening, max_multipole, pc_coulomb_int)
Setup the Semiempirical integral control type.
subroutine, public get_se_param(sep, name, typ, defined, z, zeff, natorb, eheat, beta, sto_exponents, uss, upp, udd, uff, alp, eisol, gss, gsp, gpp, gp2, acoul, nr, de, ass, asp, app, hsp, gsd, gpd, gdd, ppddg, dpddg, ngauss)
Get info from the semi-empirical type.
Working with the semi empirical parameter types.
subroutine, public finalize_se_taper(se_taper)
Finalizes the semi-empirical taper for a chunk calculation.
integer function, public get_se_type(se_method)
Gives back the unique semi_empirical METHOD type.
subroutine, public initialize_se_taper(se_taper, coulomb, exchange, lr_corr)
Initializes the semi-empirical taper for a chunk calculation.
pure subroutine, public virial_pair_force(pv_virial, f0, force, rab)
Computes the contribution to the stress tensor from two-body pair-wise forces.
Provides all information about an atomic kind.
type for the atomic properties
Type defining parameters related to the simulation cell.
to build arrays of pointers
stores all the informations relevant to an mpi environment
Provides all information about a quickstep kind.
Taper type use in semi-empirical calculations.