A routine to reset the object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ky_type), | intent(inout) | :: | self |
subroutine ky_reset(self)
use mp, only: free_comm, mp_comm_null
implicit none
class(ky_type), intent(inout) :: self
integer :: is
!Call reset on all children
do is=1,self%nsupercell
call self%supercells(is)%reset
enddo
!AJ Free communicators associated with this ky block
if(self%ky_sub_all%id /= self%parent_sub%id .and. self%ky_sub_all%nproc > 0 .and. self%ky_sub_all%id /= mp_comm_null) then
call free_comm(self%ky_sub_all)
end if
!deallocate
call self%deallocate
!Could zero out variables but no real need
end subroutine ky_reset