Skip to content
Snippets Groups Projects
Commit 5f97c7e2 authored by Philipp Rüssmann's avatar Philipp Rüssmann
Browse files

Fix kkrflex writeout bug (nofgij size assigned too small)

parent 814b1498
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,7 @@ subroutine gfshells(icc, natomimp, nsh1, nsh2, ijtabsym, ijtabsh, ijtabcalc, &
integer :: nb, i, j, pos, ii, io, ns, in, ndim, nsize, ihost, ierr
character (len=9) :: str9
logical :: lsurf, opt
integer :: nofgij_with_diag
! ..
! .. External subroutines
external :: impcheck, impcoefs, shellgen2k, opt
......@@ -172,6 +173,7 @@ subroutine gfshells(icc, natomimp, nsh1, nsh2, ijtabsym, ijtabsh, ijtabcalc, &
! avoid considering again the diagonal elements
nofgij = 0
nofgij_with_diag = 0
do i = 1, natomimp
nb = (i-1)*natomimp
do j = 1, natomimp
......@@ -189,6 +191,10 @@ subroutine gfshells(icc, natomimp, nsh1, nsh2, ijtabsym, ijtabsh, ijtabcalc, &
jofgij(nofgij) = j
ijtabcalc(nb+j) = 1
end if
! increment counter that includes diagonal elements
if ((atomimp(j)>=0)) then
nofgij_with_diag = nofgij_with_diag + 1
end if
end do
end if
end do
......@@ -199,6 +205,10 @@ subroutine gfshells(icc, natomimp, nsh1, nsh2, ijtabsym, ijtabsh, ijtabcalc, &
jofgij, nsymat, rsymat, isymindex, rotname, nshell, ratom(1,1), nsh1, &
nsh2, ish, jsh, ijtabsym, ijtabsh, ijtabcalc, 2, nsheld)
! after shells have been created reset nofgij to nofgij_with_diag.
! Otherwise a segmentation fault occurs in kkrflex (in rotgll: ijtabsh etc too small)
nofgij = nofgij_with_diag
! **********************************************************************
! --> now write out the impurity.coefs file for the impurity calculation
......
v2.3-143-g70abfd2
v2.3-144-gf97cac3
......@@ -352,6 +352,9 @@ contains
end if
if ( ( OPT('KKRFLEX ') ) ) then
!! Green functions has (lmmaxd*natomimp)**2 double complex (i.e. factor '4') values
!RECLENGTH = WLENGTH*4*NATOMIMP*LMMAXD*NATOMIMP*LMMAXD
!at the moment kkrflex_green file is only written with single precision (factor'2')
RECLENGTH = WLENGTH*2*NATOMIMP*LMMAXD*NATOMIMP*LMMAXD
! sometimes (lmax=2) the record length might be too small to store the parameters, then reclength needs to be bigger
if(RECLENGTH<8*IELAST+6) then
......
......@@ -22,7 +22,7 @@ SUBROUTINE rotgll(gmatll,natomimp,ijtabsym,ijtabsh, &
! * *
! **********************************************************************
use mod_mympi, only: myrank, master
Use mod_datatypes, Only: dp
Use mod_datatypes, Only: dp, sp
IMPLICIT NONE
! ..
......@@ -106,7 +106,6 @@ END DO
!***********************************************************************
! visualise Gij
IF ( test('Gmatij ') ) THEN
WRITE (1337,'(/,4X,70("+"),/,4X,A,I4)') &
'cluster G_ij matrices for i,j = 1,',natomimp
......@@ -175,7 +174,9 @@ IF ( igf /= 0 ) THEN
#else
irec = icall
#endif
WRITE(888,REC=irec) gclust
! force single precision complex writeout to minimize file size etc.
! maybe this can be removed in the future
WRITE(888,REC=irec) cmplx(gclust, kind=sp)
IF ( ( opt('GPLAIN ') ) ) THEN
WRITE(8888,'(50000E25.16)') gclust
endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment