30#include "./base/base_uses.f90"
35 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'min_basis_set'
52 INTEGER,
INTENT(IN) :: unit_nr
53 CHARACTER(LEN=*),
INTENT(IN),
OPTIONAL :: basis_type
54 INTEGER,
INTENT(IN),
OPTIONAL :: primitive
56 CHARACTER(LEN=2) :: element_symbol
57 CHARACTER(LEN=default_string_length) :: bname, btype
58 INTEGER :: ikind, lb, mao, ne, ngau, nkind, nprim, &
60 INTEGER,
DIMENSION(0:3) :: elcon
61 INTEGER,
DIMENSION(:),
POINTER :: econf
68 IF (
PRESENT(basis_type))
THEN
69 btype = trim(basis_type)
73 IF (
PRESENT(primitive))
THEN
80 WRITE (unit_nr,
'(T2,A,T60,A21)')
"Generate MINBAS set", adjustr(trim(btype))
83 CALL get_qs_env(qs_env=qs_env, qs_kind_set=qs_kind_set)
84 CALL get_qs_env(qs_env, dft_control=dft_control)
85 nkind =
SIZE(qs_kind_set)
87 qs_kind => qs_kind_set(ikind)
88 CALL get_qs_kind(qs_kind, zeff=zval, elec_conf=econf, element_symbol=element_symbol)
90 NULLIFY (refbasis, pbasis)
91 CALL get_qs_kind(qs_kind=qs_kind, basis_set=refbasis, basis_type=btype)
92 IF (.NOT.
ASSOCIATED(refbasis))
THEN
99 elcon(0:ne) = econf(lb:ub)
102 CALL create_min_basis(refbasis, z, elcon, mao, ngau)
110 CALL create_min_basis(refbasis, z, elcon, mao, ngau)
114 CALL get_qs_kind(qs_kind=qs_kind, basis_set=refbasis, basis_type=btype)
116 IF (unit_nr > 0)
THEN
118 WRITE (unit_nr,
'(T2,A,A,T14,A,I4,T40,A,A24)')
"Kind: ", element_symbol,
"NBasFun: ", nsgf, &
119 "Reference Basis: ", adjustl(trim(bname))
135 SUBROUTINE create_min_basis(min_basis_set, zval, econf, mao, ngau)
137 INTEGER,
INTENT(IN) :: zval
138 INTEGER,
DIMENSION(0:3) :: econf
139 INTEGER,
INTENT(IN) :: mao, ngau
141 CHARACTER(len=1),
DIMENSION(0:3),
PARAMETER :: lnam = (/
"S",
"P",
"D",
"F"/)
143 CHARACTER(len=6) :: str
144 CHARACTER(len=6),
DIMENSION(:),
POINTER :: sym
145 CHARACTER(LEN=default_string_length) :: bname
146 INTEGER :: i, iss, l, lm, n, nmao, nn, nss
147 INTEGER,
DIMENSION(0:3) :: nae, nco, npe
148 INTEGER,
DIMENSION(4, 7) :: ne
149 INTEGER,
DIMENSION(:),
POINTER :: lq, nq
150 REAL(kind=
dp),
DIMENSION(:),
POINTER :: zet
154 NULLIFY (sto_basis_set)
161 ne(l, i) =
ptable(zval)%e_conv(l - 1) - 2*nn*(i - l)
162 ne(l, i) = max(ne(l, i), 0)
163 ne(l, i) = min(ne(l, i), 2*nn)
171 nae(l) =
ptable(zval)%e_conv(l)/nn
172 IF (mod(
ptable(zval)%e_conv(l), nn) /= 0) nae(l) = nae(l) + 1
174 IF (mod(econf(l), nn) /= 0) npe(l) = npe(l) + 1
176 cpassert(all(nae - npe >= 0))
181 nmao = nmao + npe(l)*(2*l + 1)
197 IF (npe(2) == 0)
THEN
217 cpabort(
"Default setting of minimal basis failed")
219 CALL cp_warn(__location__,
"Reference basis has been adjusted according to MAO value.")
225 IF (npe(l) > 0) lm = l
228 IF (npe(l) == 0) npe(l) = 1
232 ALLOCATE (sym(nss), lq(nss), nq(nss), zet(nss))
241 WRITE (str(5:5), fmt=
'(I1)') nq(iss)
244 zet(iss) =
srules(zval, ne, nq(iss), lq(iss))
248 bname = adjustr(
ptable(zval)%symbol)//
"_MBas"
251 lq=lq, zet=zet, symbol=sym)
257 DEALLOCATE (sym, lq, nq, zet)
259 END SUBROUTINE create_min_basis
subroutine, public add_basis_set_to_container(container, basis_set, basis_set_type)
...
subroutine, public get_gto_basis_set(gto_basis_set, name, aliases, norm_type, kind_radius, ncgf, nset, nsgf, cgf_symbol, sgf_symbol, norm_cgf, set_radius, lmax, lmin, lx, ly, lz, m, ncgf_set, npgf, nsgf_set, nshell, cphi, pgf_radius, sphi, scon, zet, first_cgf, first_sgf, l, last_cgf, last_sgf, n, gcc, maxco, maxl, maxpgf, maxsgf_set, maxshell, maxso, nco_sum, npgf_sum, nshell_sum, maxder, short_kind_radius, npgf_seg_sum)
...
subroutine, public deallocate_gto_basis_set(gto_basis_set)
...
pure real(dp) function, public srules(z, ne, n, l)
...
subroutine, public deallocate_sto_basis_set(sto_basis_set)
...
subroutine, public allocate_sto_basis_set(sto_basis_set)
...
subroutine, public create_primitive_basis_set(basis_set, pbasis, lmax)
...
subroutine, public create_gto_from_sto_basis(sto_basis_set, gto_basis_set, ngauss, ortho)
...
subroutine, public set_sto_basis_set(sto_basis_set, name, nshell, symbol, nq, lq, zet)
...
subroutine, public init_orb_basis_set(gto_basis_set)
Initialise a Gaussian-type orbital (GTO) basis set data set.
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
generate or use from input minimal basis set
subroutine, public create_minbas_set(qs_env, unit_nr, basis_type, primitive)
...
Periodic Table related data definitions.
type(atom), dimension(0:nelem), public ptable
subroutine, public get_ptable_info(symbol, number, amass, ielement, covalent_radius, metallic_radius, vdw_radius, found)
Pass information about the kind given the element symbol.
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.
Calculate the interaction radii for the operator matrix calculation.
subroutine, public init_interaction_radii_orb_basis(orb_basis_set, eps_pgf_orb, eps_pgf_short)
...
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.
Provides all information about a quickstep kind.