In allocate_nlpot arrays ns and nsnew are allocated also when lda_plus_u = .FALSE.

(see comment at lines 98-100 ).
In clean_pw deallocation of g has been added.
C.S.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@342 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
sbraccia 2003-10-28 10:28:16 +00:00
parent c67ca51067
commit 0c81c4f2c3
2 changed files with 13 additions and 7 deletions

View File

@ -94,13 +94,18 @@ subroutine allocate_nlpot
allocate (qgm( ngm))
allocate (becsum( nhm * (nhm + 1)/2, nat, nspin))
!
! Allocate space for Hubbard potential
! ... Allocate space for Hubbard potential
! ... These arrays are allocated ALWAYS even if lda_plus_u = .FALSE.
! ... This is needed since they are passed as arguments of mix_rho
! ... no matter lda_plus_u is .TRUE. or .FALSE. ( 23/10/2003 C.S. )
!
! if (lda_plus_u) then
!
if (lda_plus_u) then
ldim = 2 * Hubbard_lmax + 1
allocate( ns (ldim, ldim, nspin, nat) )
allocate( nsnew (ldim, ldim, nspin, nat) )
endif
ALLOCATE( ns( ldim, ldim, nspin, nat ) )
ALLOCATE( nsnew( ldim, ldim, nspin, nat ) )
!
! endif
!
! Calculate dimensions for array tab (including a possible factor
! coming from cell contraction during variable cell relaxation/MD)

View File

@ -56,8 +56,9 @@ SUBROUTINE clean_pw
!
! ... arrays allocated in allocate_fft.f90 ( and never deallocated )
!
IF ( ALLOCATED( g ) ) DEALLOCATE( g )
IF ( ALLOCATED( gg ) ) DEALLOCATE( gg )
IF ( ALLOCATED( nl ) ) DEALLOCATE( nl)
IF ( ALLOCATED( nl ) ) DEALLOCATE( nl )
IF ( gamma_only ) THEN
IF ( ALLOCATED( nlm ) ) DEALLOCATE( nlm )
END IF