Main driver for thermochemistry calculations.
Computes all thermodynamic quantities from molecular geometry and vibrational frequencies.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | coords(:,:) |
Coordinates (3, n_atoms) in Bohr |
||
| integer, | intent(in) | :: | atomic_numbers(:) |
Atomic numbers |
||
| real(kind=dp), | intent(in) | :: | frequencies(:) |
Frequencies in cm^-1 |
||
| integer, | intent(in) | :: | n_atoms |
Number of atoms |
||
| integer, | intent(in) | :: | n_freqs |
Number of frequencies |
||
| type(thermochemistry_result_t), | intent(out) | :: | result |
Output results |
||
| real(kind=dp), | intent(in), | optional | :: | temperature |
Temperature in K (default 298.15) |
|
| real(kind=dp), | intent(in), | optional | :: | pressure |
Pressure in atm (default 1.0) |
|
| integer, | intent(in), | optional | :: | symmetry_number |
Symmetry number (default 1) |
|
| integer, | intent(in), | optional | :: | spin_multiplicity |
Spin multiplicity (default 1) |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=dp), | private | :: | P | ||||
| real(kind=dp), | private | :: | S_total | ||||
| real(kind=dp), | private | :: | T | ||||
| real(kind=dp), | private | :: | center_of_mass(3) | ||||
| integer, | private | :: | mult | ||||
| real(kind=dp), | private | :: | principal_axes(3,3) | ||||
| integer, | private | :: | sigma |
subroutine compute_thermochemistry(coords, atomic_numbers, frequencies, n_atoms, n_freqs, & result, temperature, pressure, symmetry_number, spin_multiplicity) !! Main driver for thermochemistry calculations. !! !! Computes all thermodynamic quantities from molecular geometry and vibrational frequencies. real(dp), intent(in) :: coords(:, :) !! Coordinates (3, n_atoms) in Bohr integer, intent(in) :: atomic_numbers(:) !! Atomic numbers real(dp), intent(in) :: frequencies(:) !! Frequencies in cm^-1 integer, intent(in) :: n_atoms !! Number of atoms integer, intent(in) :: n_freqs !! Number of frequencies type(thermochemistry_result_t), intent(out) :: result !! Output results real(dp), intent(in), optional :: temperature !! Temperature in K (default 298.15) real(dp), intent(in), optional :: pressure !! Pressure in atm (default 1.0) integer, intent(in), optional :: symmetry_number !! Symmetry number (default 1) integer, intent(in), optional :: spin_multiplicity !! Spin multiplicity (default 1) real(dp) :: center_of_mass(3) real(dp) :: principal_axes(3, 3) real(dp) :: T, P integer :: sigma, mult real(dp) :: S_total ! Set parameters T = DEFAULT_TEMPERATURE P = DEFAULT_PRESSURE sigma = DEFAULT_SYMMETRY_NUMBER mult = DEFAULT_SPIN_MULTIPLICITY if (present(temperature)) T = temperature if (present(pressure)) P = pressure if (present(symmetry_number)) sigma = symmetry_number if (present(spin_multiplicity)) mult = spin_multiplicity result%temperature = T result%pressure = P result%symmetry_number = sigma result%spin_multiplicity = mult ! Compute moments of inertia call compute_moments_of_inertia(coords, atomic_numbers, n_atoms, & center_of_mass, result%moments, principal_axes, & result%is_linear, result%total_mass) ! Compute rotational constants call compute_rotational_constants(result%moments, result%is_linear, result%rot_const) ! Compute ZPE call compute_zpe(frequencies, n_freqs, result%n_real_freqs, & result%zpe_hartree, result%zpe_kcalmol) result%n_imag_freqs = n_freqs - result%n_real_freqs ! Compute translational contributions call compute_translational_thermo(result%total_mass, T, P, & result%E_trans, result%S_trans, result%Cv_trans) ! Compute rotational contributions call compute_rotational_thermo(result%moments, T, sigma, result%is_linear, & result%E_rot, result%S_rot, result%Cv_rot) ! Compute vibrational contributions (thermal, excluding ZPE) call compute_vibrational_thermo(frequencies, n_freqs, T, & result%E_vib, result%S_vib, result%Cv_vib) ! Compute electronic contributions result%E_elec = 0.0_dp ! Ground state only call compute_electronic_entropy(mult, result%S_elec) ! Compute partition functions call compute_partition_functions(result%total_mass, result%moments, frequencies, n_freqs, & T, P, sigma, result%is_linear, & result%q_trans, result%q_rot, result%q_vib) ! Compute summary quantities ! Thermal correction to energy = ZPE + E_trans + E_rot + E_vib + E_elec result%thermal_correction_energy = result%zpe_hartree + & result%E_trans + result%E_rot + result%E_vib + result%E_elec ! Thermal correction to enthalpy = E_tot + RT result%thermal_correction_enthalpy = result%thermal_correction_energy + R_HARTREE*T ! Total entropy in Hartree/K S_total = (result%S_trans + result%S_rot + result%S_vib + result%S_elec)/HARTREE_TO_CALMOL ! Thermal correction to Gibbs = H - TS result%thermal_correction_gibbs = result%thermal_correction_enthalpy - T*S_total end subroutine compute_thermochemistry