Deallocate module data
subroutine hamiltonian_dealloc()
!! Deallocate module data
!============================================!
use w90_io, only: io_error
implicit none
integer :: ierr
if (allocated(ham_r)) then
deallocate (ham_r, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating ham_r in hamiltonian_dealloc')
end if
if (allocated(ham_k)) then
deallocate (ham_k, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating ham_k in hamiltonian_dealloc')
end if
if (allocated(irvec)) then
deallocate (irvec, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating irvec in hamiltonian_dealloc')
end if
if (allocated(ndegen)) then
deallocate (ndegen, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating ndegen in hamiltonian_dealloc')
end if
if (allocated(wannier_centres_translated)) then
deallocate (wannier_centres_translated, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating wannier_centres_translated in param_dealloc')
end if
ham_have_setup = .false.
have_translated = .false.
use_translation = .false.
have_ham_r = .false.
have_ham_k = .false.
hr_written = .false.
tb_written = .false.
return
end subroutine hamiltonian_dealloc