subroutine w90_wannier90_readwrite_w90_dealloc(atom_data, band_plot, dis_spheres, dis_manifold, &
exclude_bands, kmesh_input, kpt_latt, &
wann_control, proj, proj_input, select_proj, &
kpoint_path, wannier_data, wann_plot, eigval, &
error, comm)
!================================================!
use w90_error, only: w90_error_type
implicit none
! arguments
type(band_plot_type), intent(inout) :: band_plot
type(wann_control_type), intent(inout) :: wann_control
type(wannier_data_type), intent(inout) :: wannier_data
type(kmesh_input_type), intent(inout) :: kmesh_input
type(dis_spheres_type), intent(inout) :: dis_spheres
type(dis_manifold_type), intent(inout) :: dis_manifold
type(atom_data_type), intent(inout) :: atom_data
type(kpoint_path_type), intent(inout) :: kpoint_path
type(select_projection_type), intent(inout) :: select_proj
type(wannier_plot_type), intent(inout) :: wann_plot
type(proj_type), allocatable, intent(inout) :: proj(:)
type(proj_type), allocatable, intent(inout) :: proj_input(:)
type(w90_error_type), allocatable, intent(out) :: error
type(w90_comm_type), intent(in) :: comm
integer, allocatable, intent(inout) :: exclude_bands(:)
real(kind=dp), allocatable, intent(inout) :: eigval(:, :)
real(kind=dp), allocatable, intent(inout) :: kpt_latt(:, :)
! local variables
integer :: ierr
call w90_readwrite_dealloc(exclude_bands, wannier_data, proj_input, kmesh_input, kpt_latt, &
dis_manifold, atom_data, eigval, kpoint_path, error, comm)
if (allocated(error)) return
if (allocated(wann_plot%list)) then
deallocate (wann_plot%list, stat=ierr)
if (ierr /= 0) then
call set_error_dealloc(error, 'Error in deallocating wann_plot%list in w90_wannier90_readwrite_w90_dealloc', comm)
return
end if
end if
if (allocated(band_plot%project)) then
deallocate (band_plot%project, stat=ierr)
if (ierr /= 0) then
call set_error_dealloc(error, 'Error in deallocating band_plot%project in &
& w90_wannier90_readwrite_w90_dealloc', comm)
return
end if
end if
if (allocated(wann_control%guiding_centres%centres)) then
deallocate (wann_control%guiding_centres%centres, stat=ierr)
if (ierr /= 0) then
call set_error_dealloc(error, 'Error in deallocating wann_control%guiding_centres%centres &
& in w90_wannier90_readwrite_w90_dealloc', comm)
return
end if
end if
if (allocated(wann_control%constrain%centres)) then
deallocate (wann_control%constrain%centres, stat=ierr)
if (ierr /= 0) then
call set_error_dealloc(error, 'Error deallocating wann_control%constrain%centres &
& in w90_wannier90_readwrite_w90_dealloc', comm)
return
end if
end if
if (allocated(proj)) then
deallocate (proj, stat=ierr)
if (ierr /= 0) then
call set_error_dealloc(error, 'Error in deallocating proj in w90_wannier90_readwrite_w90_dealloc', comm)
return
end if
end if
if (allocated(dis_spheres%spheres)) then
deallocate (dis_spheres%spheres, stat=ierr)
if (ierr /= 0) then
call set_error_dealloc(error, 'Error in deallocating dis_spheres%spheres &
& in w90_wannier90_readwrite_w90_dealloc', comm)
return
end if
end if
if (allocated(select_proj%proj2wann_map)) then
deallocate (select_proj%proj2wann_map, stat=ierr)
if (ierr /= 0) then
call set_error_dealloc(error, 'Error in deallocating select_proj%proj2wann_map &
& in w90_wannier90_readwrite_w90_dealloc', comm)
return
end if
end if
end subroutine w90_wannier90_readwrite_w90_dealloc