system_destroy Subroutine

private subroutine system_destroy(this)

Clean up allocated memory in system_geometry_t

Type Bound

system_geometry_t

Arguments

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

Called by

proc~~system_destroy~~CalledByGraph proc~system_destroy system_geometry_t%system_destroy proc~mbe_base_destroy many_body_expansion_t%mbe_base_destroy proc~mbe_base_destroy->proc~system_destroy proc~run_multi_molecule_calculations run_multi_molecule_calculations proc~run_multi_molecule_calculations->proc~system_destroy program~main main program~main->proc~system_destroy program~main->proc~run_multi_molecule_calculations proc~gmbe_destroy gmbe_context_t%gmbe_destroy proc~gmbe_destroy->proc~mbe_base_destroy proc~mbe_destroy mbe_context_t%mbe_destroy proc~mbe_destroy->proc~mbe_base_destroy

Source Code

   subroutine system_destroy(this)
      !! Clean up allocated memory in system_geometry_t
      class(system_geometry_t), intent(inout) :: this
      if (allocated(this%element_numbers)) deallocate (this%element_numbers)
      if (allocated(this%coordinates)) deallocate (this%coordinates)
      if (allocated(this%fragment_sizes)) deallocate (this%fragment_sizes)
      if (allocated(this%fragment_atoms)) deallocate (this%fragment_atoms)
      if (allocated(this%fragment_charges)) deallocate (this%fragment_charges)
      if (allocated(this%fragment_multiplicities)) deallocate (this%fragment_multiplicities)
      if (allocated(this%bonds)) deallocate (this%bonds)
      this%n_monomers = 0
      this%atoms_per_monomer = 0
      this%total_atoms = 0
   end subroutine system_destroy