Commit 4a3f4f96 authored by Gregor Michalicek's avatar Gregor Michalicek
Browse files

Fix segmentation fault in init/brzone2.f90

The problem was that some arrays had predefined sizes that were
not adapted to the actual problem. I changed this for some arrays
now but there are still some other arrays that may become a problem
at some point, too.
parent 4d93df0b
......@@ -37,24 +37,28 @@ SUBROUTINE brzone2(rcmt,nsym,idrot,mface,nbsz,nv48,&
INTEGER :: info, n1, n2, n3, n4, i, j, k, iPlane, iSym
INTEGER :: nPlanes, nOuterPlanes, nCorners, numIBZPlanes
INTEGER :: maxNumPlanes, nUniqueCorners, duplicateNum
INTEGER :: nbszLocal
INTEGER :: nbszLocal, planesDim
INTEGER :: ipiv(3), krecip(3)
INTEGER :: cornerPlanes(3,5000), nPlaneCorners(1000)
INTEGER :: cornerPlanes(3,5000)
INTEGER :: numCornerPlanes(5000)
LOGICAL :: foundDuplicate, filterOut
LOGICAL :: isIBZPlane(1000), isIBZCorner(5000)
LOGICAL :: isIBZCorner(5000)
REAL, PARAMETER :: eps09 = 1.0e-9
REAL :: pi, maxRecDist, vecDist, recScale, scalarProduct
REAL :: norm, normalScalarProduct
REAL :: denominator, vec1Fac, vec2Fac, edgeDist
REAL :: testVec(3), sk(3), vecA(3), vecB(3), vecC(3)
REAL :: dvec(3,1000), ddist(1000), corners(3,5000)
REAL :: corners(3,5000)
REAL :: planesMatrix(3,3), solutions(3,1)
REAL :: equationSystem(3,3)
REAL :: edgeDirec(3), edgeDistVec(3), distVec(3)
INTEGER, ALLOCATABLE :: cornerPlaneList(:,:)
INTEGER, ALLOCATABLE :: planeCorners(:,:)
INTEGER, ALLOCATABLE :: nPlaneCorners(:)
REAL, ALLOCATABLE :: dvec(:,:), ddist(:)
! Subroutine plan:
! 0. Initializations
......@@ -138,6 +142,10 @@ SUBROUTINE brzone2(rcmt,nsym,idrot,mface,nbsz,nv48,&
! loops over all neighboring lattice vectors. The size of the
! neigborhood is defined by nbszLocal.
planesDim = nbszLocal*nbszLocal*nbszLocal + nsym
ALLOCATE(dvec(3,planesDim), ddist(planesDim))
nPlanes = 0
DO n1 = -nbszLocal, nbszLocal
krecip(1) = n1
......@@ -552,7 +560,7 @@ SUBROUTINE brzone2(rcmt,nsym,idrot,mface,nbsz,nv48,&
CALL juDFT_error("Brillouin zone does not fulfill Euler characterisic.",calledby ="brzone2")
DEALLOCATE (planeCorners)
DEALLOCATE (planeCorners,dvec,ddist,nPlaneCorners,isIBZPlane)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment