From 59e7a41aa2093da5a7bcd75d661f89ed60f4fbf6 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 20 Aug 2016 07:14:18 +0200 Subject: [PATCH] now longer write empty file if file given in {} not existing --- code/IO.f90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/IO.f90 b/code/IO.f90 index db0c056fe..22b56d819 100644 --- a/code/IO.f90 +++ b/code/IO.f90 @@ -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)