json_output_data_destroy Subroutine

private subroutine json_output_data_destroy(this)

Clean up all allocated memory

Type Bound

json_output_data_t

Arguments

Type IntentOptional Attributes Name
class(json_output_data_t), intent(inout) :: this

Calls

proc~~json_output_data_destroy~~CallsGraph proc~json_output_data_destroy json_output_data_t%json_output_data_destroy proc~json_output_data_reset json_output_data_t%json_output_data_reset proc~json_output_data_destroy->proc~json_output_data_reset

Called by

proc~~json_output_data_destroy~~CalledByGraph proc~json_output_data_destroy json_output_data_t%json_output_data_destroy proc~run_calculation run_calculation proc~run_calculation->proc~json_output_data_destroy proc~compute_energy_and_forces compute_energy_and_forces proc~compute_energy_and_forces->proc~run_calculation proc~run_multi_molecule_calculations run_multi_molecule_calculations proc~run_multi_molecule_calculations->proc~run_calculation program~main main program~main->proc~run_calculation program~main->proc~run_multi_molecule_calculations

Source Code

   subroutine json_output_data_destroy(this)
      !! Clean up all allocated memory
      class(json_output_data_t), intent(inout) :: this

      ! Common data
      if (allocated(this%gradient)) deallocate (this%gradient)
      if (allocated(this%hessian)) deallocate (this%hessian)
      if (allocated(this%dipole)) deallocate (this%dipole)

      ! Vibrational data
      if (allocated(this%frequencies)) deallocate (this%frequencies)
      if (allocated(this%reduced_masses)) deallocate (this%reduced_masses)
      if (allocated(this%force_constants)) deallocate (this%force_constants)
      if (allocated(this%ir_intensities)) deallocate (this%ir_intensities)

      ! MBE data
      if (allocated(this%polymers)) deallocate (this%polymers)
      if (allocated(this%fragment_energies)) deallocate (this%fragment_energies)
      if (allocated(this%delta_energies)) deallocate (this%delta_energies)
      if (allocated(this%sum_by_level)) deallocate (this%sum_by_level)
      if (allocated(this%fragment_distances)) deallocate (this%fragment_distances)

      ! GMBE PIE data
      if (allocated(this%pie_atom_sets)) deallocate (this%pie_atom_sets)
      if (allocated(this%pie_coefficients)) deallocate (this%pie_coefficients)
      if (allocated(this%pie_energies)) deallocate (this%pie_energies)

      call this%reset()
   end subroutine json_output_data_destroy