Ifort can not handle 0-length files

Not sure whether this is a bug or not:
https://software.intel.com/en-us/forums/intel-fortran-compiler/topic/856789
This commit is contained in:
Martin Diehl 2020-06-02 09:31:26 +02:00
parent 79c17ec407
commit d31417b050
1 changed files with 1 additions and 1 deletions

View File

@ -130,7 +130,7 @@ function IO_read(fileName) result(fileContent)
status='old', position='rewind', action='read',iostat=myStat) status='old', position='rewind', action='read',iostat=myStat)
if(myStat /= 0) call IO_error(100,ext_msg=trim(fileName)) if(myStat /= 0) call IO_error(100,ext_msg=trim(fileName))
allocate(character(len=fileLength)::fileContent) allocate(character(len=fileLength)::fileContent)
read(fileUnit) fileContent if(fileLength>0) read(fileUnit) fileContent
close(fileUnit) close(fileUnit)
end function IO_read end function IO_read