now longer write empty file if file given in {} not existing

This commit is contained in:
Martin Diehl 2016-08-20 07:14:18 +02:00
parent 2738415b34
commit 59e7a41aa2
1 changed files with 2 additions and 1 deletions

View File

@ -129,6 +129,7 @@ recursive function IO_read(fileUnit,reset) result(line)
!--------------------------------------------------------------------------------------------------
! normal case
if (input == '') return ! regular line
!--------------------------------------------------------------------------------------------------
! recursion case
if (stack >= 10_pInt) call IO_error(104_pInt,ext_msg=input) ! recursion limit reached
@ -141,7 +142,7 @@ recursive function IO_read(fileUnit,reset) result(line)
pathOn(stack) = path(1:scan(path,SEP,.true.))//input ! glue include to current file's dir
endif
open(newunit=unitOn(stack),iostat=myStat,file=pathOn(stack)) ! open included file
open(newunit=unitOn(stack),iostat=myStat,file=pathOn(stack),action=read) ! open included file
if (myStat /= 0_pInt) call IO_error(100_pInt,el=myStat,ext_msg=pathOn(stack))
line = IO_read(fileUnit)