release memory from allocated parameters
| Type | Intent | Optional | 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 |
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