using iostat solved the issue for ifort
but for a zero length file, ifort returns -1
This commit is contained in:
parent
d31417b050
commit
742b3718ec
|
@ -130,7 +130,8 @@ function IO_read(fileName) result(fileContent)
|
|||
status='old', position='rewind', action='read',iostat=myStat)
|
||||
if(myStat /= 0) call IO_error(100,ext_msg=trim(fileName))
|
||||
allocate(character(len=fileLength)::fileContent)
|
||||
if(fileLength>0) read(fileUnit) fileContent
|
||||
read(fileUnit,iostat=myStat) fileContent
|
||||
if(myStat > 0) call IO_error(102,ext_msg=trim(fileName))
|
||||
close(fileUnit)
|
||||
|
||||
end function IO_read
|
||||
|
|
Loading…
Reference in New Issue