51#include "./base/base_uses.f90"
61 LOGICAL :: do_iao = .false.
63 REAL(kind=
dp) :: eps_svd = 0.0_dp
64 REAL(kind=
dp) :: eps_occ = 0.0_dp
66 LOGICAL :: do_charges = .false.
68 LOGICAL :: do_oce = .false.
69 INTEGER :: lmax_oce = 0
70 INTEGER :: nbas_oce = 0
71 LOGICAL :: append_oce = .false.
73 LOGICAL :: do_bondorbitals = .false.
75 LOGICAL :: do_center = .false.
76 LOGICAL :: pos_periodic = .false.
77 INTEGER :: loc_operator = 0
78 INTEGER :: eloc_function = 0
79 REAL(kind=
dp) :: eloc_weight = 0.0_dp
81 LOGICAL :: molden_iao = .false.
82 LOGICAL :: molden_ibo = .false.
84 LOGICAL :: cubes_iao = .false.
85 LOGICAL :: cubes_ibo = .false.
88 iao_molden_section => null(), &
89 ibo_cubes_section => null(), &
90 ibo_molden_section => null(), &
91 ibo_cc_section => null()
93 LOGICAL :: do_fragments = .false.
109 iao_env%do_iao = .false.
110 iao_env%eps_svd = 0.0_dp
111 iao_env%eps_occ = 0.0_dp
113 iao_env%do_charges = .false.
115 iao_env%do_oce = .false.
117 iao_env%nbas_oce = 10
118 iao_env%append_oce = .false.
120 iao_env%do_bondorbitals = .false.
122 iao_env%do_center = .false.
123 iao_env%pos_periodic = .false.
126 iao_env%eloc_weight = 0.0_dp
128 iao_env%molden_iao = .false.
129 iao_env%molden_ibo = .false.
130 iao_env%cubes_iao = .false.
131 iao_env%cubes_ibo = .false.
133 NULLIFY (iao_env%iao_cubes_section, iao_env%iao_molden_section)
134 NULLIFY (iao_env%ibo_cubes_section, iao_env%ibo_molden_section)
135 NULLIFY (iao_env%ibo_cc_section)
152 LOGICAL :: explicit, iao_explicit
158 IF (iao_explicit)
THEN
159 iao_env%do_iao = .true.
165 CALL section_vals_get(iao_env%iao_molden_section, explicit=iao_env%molden_iao)
167 CALL section_vals_get(iao_env%iao_cubes_section, explicit=iao_env%cubes_iao)
170 IF (iao_env%do_oce)
THEN
178 IF (iao_env%do_bondorbitals)
THEN
181 CALL section_vals_val_get(subsection,
"ENERGY_LOCALIZATION_FUNCTION", i_val=iao_env%eloc_function)
184 CALL section_vals_get(iao_env%ibo_molden_section, explicit=iao_env%molden_ibo)
186 CALL section_vals_get(iao_env%ibo_cubes_section, explicit=iao_env%cubes_ibo)
189 IF (iao_env%do_center)
THEN
191 l_val=iao_env%pos_periodic, explicit=explicit)
192 IF (.NOT. explicit)
THEN
194 iao_env%pos_periodic = .true.
195 IF (
PRESENT(cell))
THEN
196 IF (all(cell%perd == 0)) iao_env%pos_periodic = .false.
212 INTENT(IN),
POINTER :: orb_basis_set_list
214 CHARACTER(len=*),
PARAMETER :: routinen =
'organise_printout_for_rose'
216 INTEGER :: after, colskip, handle, iatom, ii, &
217 ikind, iounit, jj, ncol, nfrags, nrow, &
218 rowfrag, rowskip, totalcol, totalrow
219 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: atom_of_kind, kind_of
220 LOGICAL :: lfirstcol, lfirstcoljj
224 TYPE(
cp_fm_type) :: fm_sorb, fm_sorb_frags12, fm_sorb_frags22
226 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: matrix_s
231 CALL timeset(routinen, handle)
234 NULLIFY (particle_set, atomic_kind_set)
235 CALL get_qs_env(qs_env, particle_set=particle_set, atomic_kind_set=atomic_kind_set, &
236 matrix_s_kp=matrix_s)
237 CALL get_atomic_kind_set(atomic_kind_set=atomic_kind_set, atom_of_kind=atom_of_kind, kind_of=kind_of)
238 smat => matrix_s(1, 1)%matrix
241 DO ii = 1,
SIZE(particle_set)
242 IF (nfrags < particle_set(ii)%fragment_index) &
243 nfrags = particle_set(ii)%fragment_index
248 qs_env%input,
"DFT%PRINT%IAO_ANALYSIS%IAO_OVERLAP"),
cp_p_file))
THEN
250 extension=
".Log", file_form=
"FORMATTED", file_action=
"WRITE", &
251 file_status=
"REPLACE")
252 CALL section_vals_val_get(qs_env%input,
"DFT%PRINT%IAO_ANALYSIS%IAO_OVERLAP%NDIGITS", i_val=after)
253 after = min(max(after, 1), 16)
257 NULLIFY (para_env, blacs_env)
258 CALL get_qs_env(qs_env=qs_env, blacs_env=blacs_env, para_env=para_env)
267 DO iatom = 1,
SIZE(particle_set)
268 ikind = kind_of(iatom)
269 IF (particle_set(iatom)%fragment_index == jj)
THEN
270 totalcol = totalcol + orb_basis_set_list(ikind)%gto_basis_set%nsgf
271 lfirstcoljj = .false.
272 ELSEIF (lfirstcoljj)
THEN
273 colskip = colskip + orb_basis_set_list(ikind)%gto_basis_set%nsgf
275 IF (particle_set(iatom)%fragment_index == ii)
THEN
276 totalrow = totalrow + orb_basis_set_list(ikind)%gto_basis_set%nsgf
278 ELSEIF (lfirstcol)
THEN
279 rowskip = rowskip + orb_basis_set_list(ikind)%gto_basis_set%nsgf
281 rowfrag = rowfrag + orb_basis_set_list(ikind)%gto_basis_set%nsgf
284 CALL dbcsr_get_info(matrix_s(1, 1)%matrix, nfullrows_total=nrow, nfullcols_total=ncol)
286 nrow_global=nrow, ncol_global=ncol)
287 CALL cp_fm_create(matrix=fm_sorb, matrix_struct=fmstruct, name=
"Overlap matrix S_B1")
292 nrow_global=totalrow, ncol_global=totalcol)
293 CALL cp_fm_create(matrix=fm_sorb_frags22, matrix_struct=fmstruct, name=
"Overlap matrix S_B1^kk' (S22)")
296 totalrow, totalcol, 1 + rowskip, 1 + colskip, 1, 1)
299 nrow_global=rowfrag, ncol_global=totalcol)
300 CALL cp_fm_create(matrix=fm_sorb_frags12, matrix_struct=fmstruct, name=
"Overlap matrix S_B1^k' (S12)")
302 CALL cp_fm_to_fm_submat(fm_sorb, fm_sorb_frags12, rowfrag, totalcol, 1, 1 + colskip, 1, 1)
304 IF (iounit > 0)
WRITE (iounit, *)
"FRAGMENTS kk' NR. ", ii, jj
307 IF (iounit > 0)
WRITE (iounit, *)
"FRAGMENTS kk' NR. ", ii, jj
321 CALL timestop(handle)
332 REAL(kind=
dp),
DIMENSION(:, :, :),
INTENT(IN) :: moments
333 INTEGER,
INTENT(IN),
OPTIONAL :: unit_nr
335 CHARACTER(len=*),
PARAMETER :: routinen =
'print_fragment_association'
337 INTEGER :: handle, iatom, is, ispin, jcenter, &
338 natom, ncenters, nspin
339 INTEGER,
ALLOCATABLE,
DIMENSION(:, :) :: atomcenter
340 REAL(kind=
dp) :: conv, dab, mindab
341 REAL(kind=
dp),
DIMENSION(3) :: rab
345 CALL timeset(routinen, handle)
347 NULLIFY (cell, particle_set)
348 CALL get_qs_env(qs_env=qs_env, cell=cell, particle_set=particle_set, natom=natom)
350 nspin =
SIZE(moments, 3)
351 ncenters =
SIZE(moments, 2)
352 ALLOCATE (atomcenter(ncenters, nspin))
355 DO jcenter = 1,
SIZE(moments, 2)
358 rab(:) =
pbc(particle_set(iatom)%r(:), moments(:, jcenter, ispin), cell)
359 dab = sqrt(rab(1)*rab(1) + rab(2)*rab(2) + rab(3)*rab(3))
360 IF (dab <= mindab)
THEN
362 atomcenter(jcenter, ispin) = iatom
367 IF (unit_nr > 0)
THEN
368 WRITE (unit_nr,
"(/,T2,A,i1)")
"Intrinsic Bond Orbitals: Centers associated to fragments for Spin ", &
370 WRITE (unit_nr,
"(T2,A6,T30,A6,T60,A4,T70,A8)")
"Center",
"Moment",
"Atom",
"Fragment"
372 WRITE (unit_nr,
"(i7,3F15.8,4X,I7,4X,I7)") is, moments(1:3, is, ispin), atomcenter(is, ispin), &
373 particle_set(atomcenter(is, ispin))%fragment_index
375 WRITE (unit_nr,
"(/)")
379 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.
Handles all functions related to the CELL.
methods related to the blacs parallel environment
subroutine, public dbcsr_get_info(matrix, nblkrows_total, nblkcols_total, nfullrows_total, nfullcols_total, nblkrows_local, nblkcols_local, nfullrows_local, nfullcols_local, my_prow, my_pcol, local_rows, local_cols, proc_row_dist, proc_col_dist, row_blk_size, col_blk_size, row_blk_offset, col_blk_offset, distribution, name, matrix_type, group)
...
DBCSR operations in CP2K.
subroutine, public copy_dbcsr_to_fm(matrix, fm)
Copy a DBCSR matrix to a BLACS matrix.
represent the structure of a full matrix
subroutine, public cp_fm_struct_create(fmstruct, para_env, context, nrow_global, ncol_global, nrow_block, ncol_block, descriptor, first_p_pos, local_leading_dimension, template_fmstruct, square_blocks, force_block)
allocates and initializes a full matrix structure
subroutine, public cp_fm_struct_release(fmstruct)
releases a full matrix structure
represent a full matrix distributed on many processors
subroutine, public cp_fm_create(matrix, matrix_struct, name, use_sp, nrow, ncol, set_zero)
creates a new full matrix with the given structure
subroutine, public cp_fm_to_fm_submat(msource, mtarget, nrow, ncol, s_firstrow, s_firstcol, t_firstrow, t_firstcol)
copy just a part ot the matrix
subroutine, public cp_fm_write_formatted(fm, unit, header, value_format)
Write out a full matrix in plain text.
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,...
integer, parameter, public cp_p_file
integer function, public cp_print_key_should_output(iteration_info, basis_section, print_key_path, used_print_key, first_time)
returns what should be done with the given property if btest(res,cp_p_store) then the property should...
real(kind=dp) function, public cp_unit_from_cp2k(value, unit_str, defaults, power)
converts from the internal cp2k units to the given unit
Calculate ntrinsic atomic orbitals and analyze wavefunctions.
subroutine, public iao_read_input(iao_env, iao_section, cell)
...
subroutine, public iao_set_default(iao_env)
...
subroutine, public organise_printout_for_rose(qs_env, orb_basis_set_list)
Prints fragmented overlap matrices for interface with ROSE.
subroutine, public print_fragment_association(qs_env, moments, unit_nr)
Associates IBO centers to fragments.
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, mimic, 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, sab_cneo, 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, xcint_weights, 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, rhoz_cneo_set, ecoul_1c, rho0_s_rs, rho0_s_gs, rhoz_cneo_s_rs, rhoz_cneo_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, do_rixs, tb_tblite)
Get the QUICKSTEP environment.
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
represent a blacs multidimensional parallel environment (for the mpi corrispective see cp_paratypes/m...
keeps the information about the structure of a full matrix
type of a logger, at the moment it contains just a print level starting at which level it should be l...
stores all the informations relevant to an mpi environment