From e5756389e06233821da2037f0e2eeceb123595dd Mon Sep 17 00:00:00 2001 From: Philippe WAUTELET <philippe.wautelet@aero.obs-mip.fr> Date: Tue, 2 Jul 2019 14:04:49 +0200 Subject: [PATCH] Philippe 02/07/2019: flush messages also for files opened with newunit (logical unit can be negative) --- src/LIB/SURCOUCHE/src/mode_io.f90 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/LIB/SURCOUCHE/src/mode_io.f90 b/src/LIB/SURCOUCHE/src/mode_io.f90 index 0d6f357a2..430fe98de 100644 --- a/src/LIB/SURCOUCHE/src/mode_io.f90 +++ b/src/LIB/SURCOUCHE/src/mode_io.f90 @@ -26,6 +26,7 @@ ! Philippe Wautelet: 21/01/2019: add LIO_ALLOW_NO_BACKUP and LIO_NO_WRITE to modd_io_ll to allow ! to disable writes (for bench purposes) ! P. Wautelet 04/04/2019: force write on stderr for all processes in print_msg if abort +! P. Wautelet 02/07/2019: flush messages also for files opened with newunit (logical unit can be negative) ! MODULE MODE_IO_ll @@ -859,9 +860,9 @@ IF (KVERB<=IABORTLEVEL) THEN #if 0 !Problem: loop dependency between MODE_MSG and MODE_FM (IO_FILE_CLOSE_ll call PRINT_MSG) NIO_VERB = 0 !To not get further messages (ABORT should be the last for readability) - IF (ILU>0) CALL IO_FILE_CLOSE_ll(TFILE_OUTPUTLISTING) !To flush it + IF ( ILU /= -1 ) CALL IO_FILE_CLOSE_ll(TFILE_OUTPUTLISTING) !To flush it #else - IF (ILU>0) FLUSH(UNIT=ILU) !OK in F2003 + IF ( ILU /= -1 ) FLUSH(UNIT=ILU) !OK in F2003 IF (ASSOCIATED(TLUOUT0)) FLUSH(UNIT=TLUOUT0%NLU) #endif !Add a sleep to ensure that the process(es) that have to write to stderr and to file -- GitLab