I've noticed that the xlwin=[xlwin,str] line in readinput.f90 does not work, at least with some compilers.
The produced array of lines contains gibberish and the line read last that ends up in the first element.
My compiler is Intel 2022.1.0 and Elk is 9.2.12.
My fix is a primitive one that works :)
I created the additional xxlwin in modw90.f90, and in readinput.f90 the respective case reads:
case('xlwin','wannierExtra')
if (allocated(xlwin)) deallocate(xlwin)
if (allocated(xxlwin)) deallocate(xxlwin)
allocate(xlwin(0))
nxlwin=0
do
read(50,'(A)',err=20) str
if (trim(str) == '') goto 10
allocate(xxlwin(nxlwin))
do i=1,nxlwin
xxlwin(i) = xlwin(i)
enddo
deallocate(xlwin)
nxlwin=nxlwin+1
allocate(xlwin(nxlwin))
xlwin(nxlwin)=str
do i=1,nxlwin-1
xlwin(i) = xxlwin(i)
enddo
deallocate(xxlwin)
write(*,'("Info(readinput): read an xlwin line: ",A)') str
do i=1,nxlwin
write(*,'(" xlwin(i) ",I8,A)') i,trim(xlwin(i))
end do
write(*,*)
end do
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear Developers,
I've noticed that the
xlwin=[xlwin,str]
line in readinput.f90 does not work, at least with some compilers.The produced array of lines contains gibberish and the line read last that ends up in the first element.
My compiler is Intel 2022.1.0 and Elk is 9.2.12.
My fix is a primitive one that works :)
I created the additional xxlwin in modw90.f90, and in readinput.f90 the respective case reads:
Hi Andrew,
This was fixed a couple of versions ago. It now reads:
... and uses modern Fortran's ability to extend arrays while preserving the contents.
Regards,
Kay.