w90_wannier90_readwrite_w90_dealloc Subroutine

public 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)

Uses

  • proc~~w90_wannier90_readwrite_w90_dealloc~~UsesGraph proc~w90_wannier90_readwrite_w90_dealloc w90_wannier90_readwrite_w90_dealloc module~w90_error w90_error proc~w90_wannier90_readwrite_w90_dealloc->module~w90_error module~w90_comms w90_comms module~w90_error->module~w90_comms module~w90_error_base w90_error_base module~w90_error->module~w90_error_base module~w90_comms->module~w90_error_base module~w90_constants w90_constants module~w90_comms->module~w90_constants

Arguments

Type IntentOptional Attributes Name
type(atom_data_type), intent(inout) :: atom_data
type(band_plot_type), intent(inout) :: band_plot
type(dis_spheres_type), intent(inout) :: dis_spheres
type(dis_manifold_type), intent(inout) :: dis_manifold
integer, intent(inout), allocatable :: exclude_bands(:)
type(kmesh_input_type), intent(inout) :: kmesh_input
real(kind=dp), intent(inout), allocatable :: kpt_latt(:,:)
type(wann_control_type), intent(inout) :: wann_control
type(proj_type), intent(inout), allocatable :: proj(:)
type(proj_type), intent(inout), allocatable :: proj_input(:)
type(select_projection_type), intent(inout) :: select_proj
type(kpoint_path_type), intent(inout) :: kpoint_path
type(wannier_data_type), intent(inout) :: wannier_data
type(wannier_plot_type), intent(inout) :: wann_plot
real(kind=dp), intent(inout), allocatable :: eigval(:,:)
type(w90_error_type), intent(out), allocatable :: error
type(w90_comm_type), intent(in) :: comm

Calls

proc~~w90_wannier90_readwrite_w90_dealloc~~CallsGraph proc~w90_wannier90_readwrite_w90_dealloc w90_wannier90_readwrite_w90_dealloc proc~set_error_dealloc set_error_dealloc proc~w90_wannier90_readwrite_w90_dealloc->proc~set_error_dealloc proc~w90_readwrite_dealloc w90_readwrite_dealloc proc~w90_wannier90_readwrite_w90_dealloc->proc~w90_readwrite_dealloc proc~comms_sync_error comms_sync_error proc~set_error_dealloc->proc~comms_sync_error proc~set_base_error set_base_error proc~set_error_dealloc->proc~set_base_error proc~w90_readwrite_dealloc->proc~set_error_dealloc

Source Code

  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