Populate json_data with vibrational analysis results
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(json_output_data_t), | intent(out) | :: | json_data | |||
| type(calculation_result_t), | intent(in) | :: | result | |||
| real(kind=dp), | intent(in) | :: | frequencies(:) | |||
| real(kind=dp), | intent(in) | :: | reduced_masses(:) | |||
| real(kind=dp), | intent(in) | :: | force_constants(:) | |||
| type(thermochemistry_result_t), | intent(in) | :: | thermo_result | |||
| real(kind=dp), | intent(in), | optional | :: | ir_intensities(:) |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | n_modes |
subroutine populate_vibrational_json_data(json_data, result, frequencies, reduced_masses, & force_constants, thermo_result, ir_intensities) !! Populate json_data with vibrational analysis results use mqc_json_output_types, only: json_output_data_t, OUTPUT_MODE_UNFRAGMENTED use mqc_thermochemistry, only: thermochemistry_result_t type(json_output_data_t), intent(out) :: json_data type(calculation_result_t), intent(in) :: result real(dp), intent(in) :: frequencies(:) real(dp), intent(in) :: reduced_masses(:) real(dp), intent(in) :: force_constants(:) type(thermochemistry_result_t), intent(in) :: thermo_result real(dp), intent(in), optional :: ir_intensities(:) integer :: n_modes n_modes = size(frequencies) json_data%output_mode = OUTPUT_MODE_UNFRAGMENTED json_data%total_energy = result%energy%total() json_data%has_energy = .true. ! Copy gradient if available if (result%has_gradient) then allocate (json_data%gradient(size(result%gradient, 1), size(result%gradient, 2))) json_data%gradient = result%gradient json_data%has_gradient = .true. end if ! Copy dipole if available if (result%has_dipole) then allocate (json_data%dipole(3)) json_data%dipole = result%dipole json_data%has_dipole = .true. end if ! Copy Hessian if available if (result%has_hessian) then allocate (json_data%hessian(size(result%hessian, 1), size(result%hessian, 2))) json_data%hessian = result%hessian json_data%has_hessian = .true. end if ! Copy vibrational data allocate (json_data%frequencies(n_modes)) allocate (json_data%reduced_masses(n_modes)) allocate (json_data%force_constants(n_modes)) json_data%frequencies = frequencies json_data%reduced_masses = reduced_masses json_data%force_constants = force_constants json_data%has_vibrational = .true. ! Copy IR intensities if available if (present(ir_intensities)) then allocate (json_data%ir_intensities(n_modes)) json_data%ir_intensities = ir_intensities json_data%has_ir_intensities = .true. end if ! Copy thermochemistry json_data%thermo = thermo_result end subroutine populate_vibrational_json_data