w90_readwrite_dealloc Subroutine

public subroutine w90_readwrite_dealloc(exclude_bands, wannier_data, input_proj, kmesh_input, kpt_latt, dis_manifold, atom_data, eigval, kpoint_path, error, comm)

Uses

  • proc~~w90_readwrite_dealloc~~UsesGraph proc~w90_readwrite_dealloc w90_readwrite_dealloc module~w90_error w90_error proc~w90_readwrite_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

release memory from allocated parameters

Arguments

Type IntentOptional Attributes Name
integer, intent(inout), allocatable :: exclude_bands(:)
type(wannier_data_type), intent(inout) :: wannier_data
type(proj_type), intent(inout), allocatable :: input_proj(:)
type(kmesh_input_type), intent(inout) :: kmesh_input
real(kind=dp), intent(inout), allocatable :: kpt_latt(:,:)
type(dis_manifold_type), intent(inout) :: dis_manifold
type(atom_data_type), intent(inout) :: atom_data
real(kind=dp), intent(inout), allocatable :: eigval(:,:)
type(kpoint_path_type), intent(inout) :: kpoint_path
type(w90_error_type), intent(out), allocatable :: error
type(w90_comm_type), intent(in) :: comm

Calls

proc~~w90_readwrite_dealloc~~CallsGraph proc~w90_readwrite_dealloc w90_readwrite_dealloc proc~set_error_dealloc set_error_dealloc proc~w90_readwrite_dealloc->proc~set_error_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

Called by

proc~~w90_readwrite_dealloc~~CalledByGraph proc~w90_readwrite_dealloc w90_readwrite_dealloc proc~w90_postw90_readwrite_dealloc w90_postw90_readwrite_dealloc proc~w90_postw90_readwrite_dealloc->proc~w90_readwrite_dealloc proc~w90_wannier90_readwrite_w90_dealloc w90_wannier90_readwrite_w90_dealloc proc~w90_wannier90_readwrite_w90_dealloc->proc~w90_readwrite_dealloc

Source Code

  subroutine w90_readwrite_dealloc(exclude_bands, wannier_data, input_proj, kmesh_input, kpt_latt, &
                                   dis_manifold, atom_data, eigval, kpoint_path, error, comm)
    !================================================!
    !! release memory from allocated parameters
    !
    !================================================
    use w90_error, only: w90_error_type, set_error_dealloc

    implicit none

    integer, allocatable, intent(inout) :: exclude_bands(:)
    real(kind=dp), allocatable, intent(inout) :: eigval(:, :)
    real(kind=dp), allocatable, intent(inout) :: kpt_latt(:, :)
    type(atom_data_type), intent(inout) :: atom_data
    type(dis_manifold_type), intent(inout) :: dis_manifold
    type(kmesh_input_type), intent(inout) :: kmesh_input
    type(kpoint_path_type), intent(inout) :: kpoint_path
    type(proj_type), allocatable, intent(inout) :: input_proj(:)
    type(w90_comm_type), intent(in) :: comm
    type(w90_error_type), allocatable, intent(out) :: error
    type(wannier_data_type), intent(inout) :: wannier_data

    integer :: ierr

    if (allocated(dis_manifold%ndimwin)) then
      deallocate (dis_manifold%ndimwin, stat=ierr)
      if (ierr /= 0) then
        call set_error_dealloc(error, 'Error in deallocating ndimwin in w90_readwrite_dealloc', comm)
        return
      end if
    end if
    if (allocated(dis_manifold%lwindow)) then
      deallocate (dis_manifold%lwindow, stat=ierr)
      if (ierr /= 0) then
        call set_error_dealloc(error, 'Error in deallocating lwindow in w90_readwrite_dealloc', comm)
        return
      end if
    end if
    if (allocated(eigval)) then
      deallocate (eigval, stat=ierr)
      if (ierr /= 0) then
        call set_error_dealloc(error, 'Error in deallocating eigval in w90_readwrite_dealloc', comm)
        return
      end if
    end if
    if (allocated(kmesh_input%shell_list)) then
      deallocate (kmesh_input%shell_list, stat=ierr)
      if (ierr /= 0) then
        call set_error_dealloc(error, 'Error in deallocating shell_list in w90_readwrite_dealloc', comm)
        return
      end if
    end if
    if (allocated(kpt_latt)) then
      deallocate (kpt_latt, stat=ierr)
      if (ierr /= 0) then
        call set_error_dealloc(error, 'Error in deallocating kpt_latt in w90_readwrite_dealloc', comm)
        return
      end if
    end if
    if (allocated(kpoint_path%labels)) then
      deallocate (kpoint_path%labels, stat=ierr)
      if (ierr /= 0) then
        call set_error_dealloc(error, 'Error in deallocating labels in w90_readwrite_dealloc', comm)
        return
      end if
    end if
    if (allocated(kpoint_path%points)) then
      deallocate (kpoint_path%points, stat=ierr)
      if (ierr /= 0) then
        call set_error_dealloc(error, 'Error in deallocating points in w90_readwrite_dealloc', comm)
        return
      end if
    end if
    if (allocated(atom_data%label)) then
      deallocate (atom_data%label, stat=ierr)
      if (ierr /= 0) then
        call set_error_dealloc(error, 'Error in deallocating atoms_label in w90_readwrite_dealloc', comm)
        return
      end if
    end if
    if (allocated(atom_data%symbol)) then
      deallocate (atom_data%symbol, stat=ierr)
      if (ierr /= 0) then
        call set_error_dealloc(error, 'Error in deallocating atoms_symbol in w90_readwrite_dealloc', comm)
        return
      end if
    end if
    if (allocated(atom_data%pos_cart)) then
      deallocate (atom_data%pos_cart, stat=ierr)
      if (ierr /= 0) then
        call set_error_dealloc(error, 'Error in deallocating atoms_pos_cart in w90_readwrite_dealloc', comm)
        return
      end if
    end if
    if (allocated(atom_data%species_num)) then
      deallocate (atom_data%species_num, stat=ierr)
      if (ierr /= 0) then
        call set_error_dealloc(error, 'Error in deallocating atoms_species_num in w90_readwrite_dealloc', comm)
        return
      end if
    end if
    if (allocated(input_proj)) then
      deallocate (input_proj, stat=ierr)
      if (ierr /= 0) then
        call set_error_dealloc(error, 'Error in deallocating input_proj in w90_readwrite_dealloc', comm)
        return
      end if
    end if
    if (allocated(exclude_bands)) then
      deallocate (exclude_bands, stat=ierr)
      if (ierr /= 0) then
        call set_error_dealloc(error, 'Error in deallocating exclude_bands in w90_readwrite_dealloc', comm)
        return
      end if
    end if
    if (allocated(wannier_data%centres)) then
      deallocate (wannier_data%centres, stat=ierr)
      if (ierr /= 0) then
        call set_error_dealloc(error, 'Error in deallocating wannier_centres in w90_readwrite_dealloc', comm)
        return
      end if
    end if
    if (allocated(wannier_data%spreads)) then
      deallocate (wannier_data%spreads, stat=ierr)
      if (ierr /= 0) then
        call set_error_dealloc(error, 'Error in deallocating wannier_spreads in w90_readwrite_dealloc', comm)
        return
      end if
    end if
  end subroutine w90_readwrite_dealloc