The recent changes to FFT grids break phonon, and presumably many others,

if 1) FFT dimensions are read from input, and 2) "clean_pw" is called
(for instance with finite k in order to perform a non-scf case). 
I modified clean_pw so that it keeps track of the previous values of 
the FFT dimensions. This should simply revert to the previous behavior.
A better solution would be to write routine that allocate and deallocate only 
k-point-related variables, since this is what we typically need.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13009 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
giannozz 2016-09-23 05:30:52 +00:00
parent d90b14c2d1
commit 112309275a
1 changed files with 12 additions and 1 deletions

View File

@ -68,7 +68,7 @@ SUBROUTINE clean_pw( lflag )
!
LOGICAL, INTENT(IN) :: lflag
!
INTEGER :: nt
INTEGER :: nt, nr1,nr2,nr3
!
IF ( lflag ) THEN
!
@ -172,8 +172,19 @@ SUBROUTINE clean_pw( lflag )
!
! ... fft structures allocated in data_structure.f90
!
! UGLY HACK WARNING: unlike previous versions, fft_type_deallocate
! removes all information about FFT grids, including FFT dimensions.
! If however FFT dimensions were set from input data, one may end
! up with a different grid if FFT grids are re-initialized later.
! The following workaround restores the previous functionality.
! TODO: replace clean_pw with more fine-grained cleaning routines.
nr1 = dfftp%nr1; nr2 = dfftp%nr2; nr3 = dfftp%nr3
CALL fft_type_deallocate( dfftp )
dfftp%nr1 = nr1; dfftp%nr2 = nr2; dfftp%nr3 = nr3
!
nr1 = dffts%nr1; nr2 = dffts%nr2; nr3 = dffts%nr3
CALL fft_type_deallocate( dffts )
dffts%nr1 = nr1; dffts%nr2 = nr2; dffts%nr3 = nr3
!
! ... stick-owner matrix allocated in sticks_base
!