From 23708d9a76699e7f09c74482e9d94cedee0753f1 Mon Sep 17 00:00:00 2001 From: Gregor Michalicek Date: Wed, 12 Jun 2019 14:45:18 +0200 Subject: [PATCH] Cured segmentation fault error symptom in cdnval In some calculations a segmentation fault occured when the we and eig arrays in cdnval were allocated. No reason for this was identified. Every parameter was harmless. To avoid the occurence of this error at this place I just moved these arrays to the stack. It seems to help and up to now no other error at a different place occured. --- cdn/cdnval.F90 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cdn/cdnval.F90 b/cdn/cdnval.F90 index 9df57a47..29f54ae7 100644 --- a/cdn/cdnval.F90 +++ b/cdn/cdnval.F90 @@ -94,8 +94,8 @@ SUBROUTINE cdnval(eig_id, mpi,kpts,jspin,noco,input,banddos,cell,atoms,enpara,st LOGICAL :: l_orbcomprot, l_real, l_dosNdir, l_corespec ! Local Arrays - REAL, ALLOCATABLE :: we(:) - REAL, ALLOCATABLE :: eig(:) + REAL :: we(MAXVAL(cdnvalJob%noccbd(:kpts%nkpt))) + REAL :: eig(MAXVAL(cdnvalJob%noccbd(:kpts%nkpt))) REAL, ALLOCATABLE :: f(:,:,:,:),g(:,:,:,:),flo(:,:,:,:) ! radial functions TYPE (t_lapw) :: lapw @@ -171,8 +171,7 @@ SUBROUTINE cdnval(eig_id, mpi,kpts,jspin,noco,input,banddos,cell,atoms,enpara,st skip_tt = dot_product(enpara%skiplo(:atoms%ntype,jspin),atoms%neq(:atoms%ntype)) IF (noco%l_soc.OR.noco%l_noco) skip_tt = 2 * skip_tt - ALLOCATE (we(MAXVAL(cdnvalJob%noccbd(:)))) - ALLOCATE (eig(MAXVAL(cdnvalJob%noccbd(:)))) + jsp = MERGE(1,jspin,noco%l_noco) DO ikpt = cdnvalJob%ikptStart, cdnvalJob%nkptExtended, cdnvalJob%ikptIncrement -- GitLab