Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Variables
Type
Visibility
Attributes
Name
Initial
integer,
private
::
i
integer,
private
::
iatom
real(kind=dp),
private
::
inv_sqrt_mass
integer,
private
::
j
integer,
private
::
k
real(kind=dp),
private
::
mass
integer,
private
::
n_atoms
integer,
private
::
n_coords
real(kind=dp),
private
::
trdip(3)
Source Code
subroutine compute_ir_intensities(dipole_derivatives,eigenvectors,element_numbers,ir_intensities)!! Compute IR intensities from dipole derivatives and normal modes.!!!! IR intensities are computed by transforming Cartesian dipole derivatives!! to normal mode coordinates and computing the squared magnitude.!!!! For each normal mode i:!! trdip(k) = Σ_j dipd(k,j) * L(j,i) * 1/√m_j!! IR(i) = AU_TO_KMMOL * (trdip(1)² + trdip(2)² + trdip(3)²)!!!! where:!! dipd(k,j) = ∂μ_k/∂x_j (Cartesian dipole derivative)!! L(j,i) = mass-weighted eigenvector component!! m_j = atomic mass for coordinate j!!real(dp),intent(in)::dipole_derivatives(:,:)!! Cartesian dipole derivatives (3, 3*N) in atomic unitsreal(dp),intent(in)::eigenvectors(:,:)!! Mass-weighted eigenvectors from Hessian diagonalization (3*N x 3*N)integer,intent(in)::element_numbers(:)!! Atomic numbers for each atom (N atoms)real(dp),allocatable,intent(out)::ir_intensities(:)!! IR intensities in km/mol (one per mode)integer::n_atoms,n_coords,iatom,i,j,kreal(dp)::mass,inv_sqrt_mass,trdip(3)n_atoms=size(element_numbers)n_coords=3*n_atomsallocate(ir_intensities(n_coords))! For each normal mode ido i=1,n_coordstrdip=0.0_dp! Transform dipole derivative from Cartesian to normal mode coordinates! trdip(k) = Σ_j dipd(k,j) * L(j,i) * amass_au(j)! where amass_au(j) = 1/√(m_j in atomic units) = 1/√(m_amu * AMU_TO_AU)! This matches xtb's formula in hessian.F90 lines 526-535do j=1,n_coordsiatom=(j-1)/3+1mass=element_mass(element_numbers(iatom))! Convert mass to atomic units (electron masses) before taking sqrtinv_sqrt_mass=1.0_dp/sqrt(mass*AMU_TO_AU)do k=1,3! x, y, z components of dipoletrdip(k)=trdip(k)+dipole_derivatives(k,j)*eigenvectors(j,i)*inv_sqrt_massend do end do! IR intensity = |dμ/dQ|² * conversion factorir_intensities(i)=AU_TO_KMMOL*(trdip(1)**2+trdip(2)**2+trdip(3)**2)end do end subroutine compute_ir_intensities