populate_vibrational_json_data Subroutine

subroutine populate_vibrational_json_data(json_data, result, frequencies, reduced_masses, force_constants, thermo_result, ir_intensities)

Uses

  • proc~~populate_vibrational_json_data~~UsesGraph proc~populate_vibrational_json_data populate_vibrational_json_data module~mqc_json_output_types mqc_json_output_types proc~populate_vibrational_json_data->module~mqc_json_output_types module~mqc_thermochemistry mqc_thermochemistry proc~populate_vibrational_json_data->module~mqc_thermochemistry module~mqc_json_output_types->module~mqc_thermochemistry pic_types pic_types module~mqc_json_output_types->pic_types module~mqc_elements mqc_elements module~mqc_thermochemistry->module~mqc_elements module~mqc_physical_constants mqc_physical_constants module~mqc_thermochemistry->module~mqc_physical_constants pic_io pic_io module~mqc_thermochemistry->pic_io pic_lapack_interfaces pic_lapack_interfaces module~mqc_thermochemistry->pic_lapack_interfaces pic_logger pic_logger module~mqc_thermochemistry->pic_logger module~mqc_thermochemistry->pic_types module~mqc_elements->pic_types pic_ascii pic_ascii module~mqc_elements->pic_ascii module~mqc_physical_constants->pic_types

Populate json_data with vibrational analysis results

Arguments

Type IntentOptional 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(:)

Calls

proc~~populate_vibrational_json_data~~CallsGraph proc~populate_vibrational_json_data populate_vibrational_json_data proc~energy_total energy_t%energy_total proc~populate_vibrational_json_data->proc~energy_total proc~mp2_total mp2_energy_t%mp2_total proc~energy_total->proc~mp2_total

Called by

proc~~populate_vibrational_json_data~~CalledByGraph proc~populate_vibrational_json_data populate_vibrational_json_data proc~hessian_coordinator hessian_coordinator proc~hessian_coordinator->proc~populate_vibrational_json_data interface~hessian_coordinator hessian_coordinator interface~hessian_coordinator->proc~hessian_coordinator proc~distributed_unfragmented_hessian distributed_unfragmented_hessian proc~distributed_unfragmented_hessian->interface~hessian_coordinator interface~distributed_unfragmented_hessian distributed_unfragmented_hessian interface~distributed_unfragmented_hessian->proc~distributed_unfragmented_hessian proc~run_unfragmented_calculation run_unfragmented_calculation proc~run_unfragmented_calculation->interface~distributed_unfragmented_hessian

Variables

Type Visibility Attributes Name Initial
integer, private :: n_modes

Source Code

   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