Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 23 additions & 19 deletions src/disentangle.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2490,16 +2490,18 @@ subroutine dis_extract(dis_control, kmesh_info, sitesym, print_output, dis_manif
call set_error_alloc(error, 'Error allocating wkomegai1 in dis_extract', comm)
return
endif
allocate (czmat_in(num_bands, num_bands, num_kpts), stat=ierr)
if (ierr /= 0) then
call set_error_alloc(error, 'Error allocating czmat_in in dis_extract', comm)
return
endif
allocate (czmat_out(num_bands, num_bands, num_kpts), stat=ierr)
if (ierr /= 0) then
call set_error_alloc(error, 'Error allocating czmat_out in dis_extract', comm)
return
endif
if (lsitesymmetry) then !we only need these large arrays for the symmetry code
allocate (czmat_in(num_bands, num_bands, num_kpts), stat=ierr)
if (ierr /= 0) then
call set_error_alloc(error, 'Error allocating czmat_in in dis_extract', comm)
return
endif
allocate (czmat_out(num_bands, num_bands, num_kpts), stat=ierr)
if (ierr /= 0) then
call set_error_alloc(error, 'Error allocating czmat_out in dis_extract', comm)
return
endif
end if
allocate (history(dis_control%conv_window), stat=ierr)
if (ierr /= 0) then
call set_error_alloc(error, 'Error allocating history in dis_extract', comm)
Expand Down Expand Up @@ -2934,15 +2936,17 @@ subroutine dis_extract(dis_control, kmesh_info, sitesym, print_output, dis_manif
enddo
! [BIG ITERATION LOOP (iter)]

deallocate (czmat_out, stat=ierr)
if (ierr /= 0) then
call set_error_dealloc(error, 'Error deallocating czmat_out in dis_extract', comm)
return
endif
deallocate (czmat_in, stat=ierr)
if (ierr /= 0) then
call set_error_dealloc(error, 'Error deallocating czmat_in in dis_extract', comm)
return
if (lsitesymmetry) then
deallocate (czmat_out, stat=ierr)
if (ierr /= 0) then
call set_error_dealloc(error, 'Error deallocating czmat_out in dis_extract', comm)
return
endif
deallocate (czmat_in, stat=ierr)
if (ierr /= 0) then
call set_error_dealloc(error, 'Error deallocating czmat_in in dis_extract', comm)
return
endif
endif
deallocate (czmat_out_loc, stat=ierr)
if (ierr /= 0) then
Expand Down
Loading