empty file needs special case for Ifort
This commit is contained in:
parent
c3b7ff3a05
commit
7bfd7a42ea
|
@ -115,6 +115,10 @@ function IO_read_ASCII(fileName) result(fileContent)
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
! read data as stream
|
! read data as stream
|
||||||
inquire(file = fileName, size=fileLength)
|
inquire(file = fileName, size=fileLength)
|
||||||
|
if (fileLength == 0) then
|
||||||
|
allocate(fileContent(0))
|
||||||
|
return
|
||||||
|
endif
|
||||||
open(newunit=fileUnit, file=fileName, access='stream',&
|
open(newunit=fileUnit, file=fileName, access='stream',&
|
||||||
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))
|
||||||
|
@ -186,6 +190,10 @@ recursive function IO_recursiveRead(fileName,cnt) result(fileContent)
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
! read data as stream
|
! read data as stream
|
||||||
inquire(file = fileName, size=fileLength)
|
inquire(file = fileName, size=fileLength)
|
||||||
|
if (fileLength == 0) then
|
||||||
|
allocate(fileContent(0))
|
||||||
|
return
|
||||||
|
endif
|
||||||
open(newunit=fileUnit, file=fileName, access='stream',&
|
open(newunit=fileUnit, file=fileName, access='stream',&
|
||||||
status='old', position='rewind', action='read',iostat=myStat)
|
status='old', position='rewind', action='read',iostat=myStat)
|
||||||
if(myStat /= 0_pInt) call IO_error(100_pInt,ext_msg=trim(fileName))
|
if(myStat /= 0_pInt) call IO_error(100_pInt,ext_msg=trim(fileName))
|
||||||
|
|
Loading…
Reference in New Issue