From 72326e12cbe12a852a23460aeca3cdbaf9043bbb Mon Sep 17 00:00:00 2001 From: Gregor Michalicek Date: Tue, 7 Jul 2020 21:15:51 +0200 Subject: [PATCH] Fix allocation of several arrays in vgen/pw_tofrom_grid.F90 for LDA. --- vgen/pw_tofrom_grid.F90 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vgen/pw_tofrom_grid.F90 b/vgen/pw_tofrom_grid.F90 index 98ff8f5c..f0e613f2 100644 --- a/vgen/pw_tofrom_grid.F90 +++ b/vgen/pw_tofrom_grid.F90 @@ -115,11 +115,15 @@ CONTAINS IF (PRESENT(rho)) ALLOCATE(rho(0:ifftd-1,jspins)) ENDIF IF (l_noco) THEN + IF (l_rdm) THEN + ALLOCATE (rhodiag(0:SIZE(rho,1)-1,jspins)) + ALLOCATE (sinsqu(0:SIZE(rho,1)-1),cossqu(0:SIZE(rho,1)-1),sincos(0:SIZE(rho,1)-1),exi(0:SIZE(rho,1)-1)) + END IF IF (dograds) THEN ALLOCATE( mx(0:ifftxc3-1),my(0:ifftxc3-1),magmom(0:ifftxc3-1)) IF (l_rdm) THEN - ALLOCATE( rhodiag(0:ifftxc3-1,jspins),der(0:ifftxc3-1,3,4),dder(0:ifftxc3-1,3,3,4),rhdd(0:ifftxc3-1,2,3,3) ) - ALLOCATE( sinsqu(0:ifftxc3-1),cossqu(0:ifftxc3-1),sincos(0:ifftxc3-1),exi(0:ifftxc3-1) ) + ALLOCATE( der(0:ifftxc3-1,3,4),dder(0:ifftxc3-1,3,3,4),rhdd(0:ifftxc3-1,2,3,3) ) + ELSE ALLOCATE( dmagmom(0:ifftxc3-1,3),ddmagmom(0:ifftxc3-1,3,3) ) ENDIF -- GitLab