hamiltonian_dealloc Subroutine

public subroutine hamiltonian_dealloc()

Uses

  • proc~~hamiltonian_dealloc~~UsesGraph proc~hamiltonian_dealloc hamiltonian_dealloc module~w90_io w90_io proc~hamiltonian_dealloc->module~w90_io module~w90_constants w90_constants module~w90_io->module~w90_constants

Deallocate module data

Arguments

None

Called by

proc~~hamiltonian_dealloc~~CalledByGraph proc~hamiltonian_dealloc hamiltonian_dealloc program~wannier wannier program~wannier->proc~hamiltonian_dealloc proc~wannier_run wannier_run proc~wannier_run->proc~hamiltonian_dealloc

Contents

Source Code


Source Code

  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