particle_soa_deallocate Subroutine

private subroutine particle_soa_deallocate(this)

Release every field array and reset both counters to zero.

Type Bound

particle_soa_t

Arguments

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

Container to empty.


Source Code

   subroutine particle_soa_deallocate(this)
      !! Release every field array and reset both counters to zero.
      class(particle_soa_t), intent(inout) :: this
         !! Container to empty.

      if (allocated(this%id)) deallocate (this%id)
      if (allocated(this%x)) deallocate (this%x)
      if (allocated(this%y)) deallocate (this%y)
      if (allocated(this%z)) deallocate (this%z)
      if (allocated(this%mass)) deallocate (this%mass)
      if (allocated(this%active)) deallocate (this%active)
      this%extent%used = 0
      this%extent%capacity = 0
   end subroutine particle_soa_deallocate