This commit is contained in:
Martin Diehl 2021-07-22 15:11:38 +02:00
parent aace5d25a8
commit d9aa638ad7
1 changed files with 2 additions and 7 deletions

View File

@ -81,12 +81,7 @@ function IO_readlines(fileName) result(fileContent)
rawData = IO_read(fileName) rawData = IO_read(fileName)
!-------------------------------------------------------------------------------------------------- N_lines = count([(rawData(l:l) == IO_EOL,l=1,len(rawData))])
! count lines to allocate string array
N_lines = 0
do l=1, len(rawData)
if (rawData(l:l) == IO_EOL) N_lines = N_lines+1
enddo
allocate(fileContent(N_lines)) allocate(fileContent(N_lines))
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------