A routine to reset the object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(supercell_type), | intent(inout) | :: | self |
subroutine sc_reset(self)
use mp, only: free_comm
implicit none
class(supercell_type), intent(inout) :: self
integer :: ic
!Call reset on all children
do ic=1,self%ncell
call self%cells(ic)%reset
enddo
! Free up communicators created for this supercell
if(self%sc_sub_all%nproc>0 .and. self%sc_sub_all%id/=self%parent_sub%id) then
call free_comm(self%sc_sub_all)
end if
if(self%sc_sub_pd%nproc>0) then
call free_comm(self%sc_sub_pd)
end if
!deallocate
call self%deallocate
!Could zero out variables but no real need
end subroutine sc_reset