diff --git a/src/LIB/SURCOUCHE/src/mode_msg.f90 b/src/LIB/SURCOUCHE/src/mode_msg.f90 index a3d919399fe79b5a96a4fe84e022f735a43aeeb8..4dae83b372659e81d36c3c99b3f4d405bf6f4e3a 100644 --- a/src/LIB/SURCOUCHE/src/mode_msg.f90 +++ b/src/LIB/SURCOUCHE/src/mode_msg.f90 @@ -115,13 +115,19 @@ IF (ASSOCIATED(TFILE_OUTPUTLISTING)) THEN ILU = TFILE_OUTPUTLISTING%NLU ELSE GWRITE_OUTLST = .FALSE. - IF (GWRITE_STDOUT) WRITE(UNIT=OUTPUT_UNIT,FMT=*) 'TFILE_OUTPUTLISTING not opened' + IF (GWRITE_STDOUT) THEN + WRITE(UNIT=OUTPUT_UNIT,FMT=*) 'TFILE_OUTPUTLISTING not opened' + FLUSH(UNIT=OUTPUT_UNIT) + END IF END IF ELSE !PW: TODO?: temporary to detect non-initialisation ! should disappear except at the beginning of a run GWRITE_OUTLST = .FALSE. - IF (GWRITE_STDOUT .AND. CPROGRAM/='LFICDF') WRITE(UNIT=OUTPUT_UNIT,FMT=*) 'TFILE_OUTPUTLISTING not associated' + IF (GWRITE_STDOUT .AND. CPROGRAM/='LFICDF') THEN + WRITE(UNIT=OUTPUT_UNIT,FMT=*) 'TFILE_OUTPUTLISTING not associated' + FLUSH(UNIT=OUTPUT_UNIT) + END IF END IF ! SELECT CASE(HDOMAIN) @@ -136,8 +142,14 @@ SELECT CASE(HDOMAIN) IMAXVERB = NGEN_VERB IABORTLEVEL = NGEN_ABORT_LEVEL CASE DEFAULT - IF (GWRITE_STDOUT) WRITE(UNIT=OUTPUT_UNIT,FMT=*) 'ERROR: PRINT_MSG: wrong message category (',TRIM(HDOMAIN),')' - IF (GWRITE_OUTLST) WRITE(UNIT=ILU, FMT=*) 'ERROR: PRINT_MSG: wrong message category (',TRIM(HDOMAIN),')' + IF (GWRITE_STDOUT) THEN + WRITE(UNIT=OUTPUT_UNIT,FMT=*) 'ERROR: PRINT_MSG: wrong message category (',TRIM(HDOMAIN),')' + FLUSH(UNIT=OUTPUT_UNIT) + END IF + IF (GWRITE_OUTLST) THEN + WRITE(UNIT=ILU, FMT=*) 'ERROR: PRINT_MSG: wrong message category (',TRIM(HDOMAIN),')' + FLUSH(UNIT=ILU) + END IF RETURN END SELECT ! @@ -162,8 +174,14 @@ SELECT CASE(KVERB) YPRE='DEBUG: ' ndebug = ndebug + 1 CASE DEFAULT - IF (GWRITE_STDOUT) WRITE(UNIT=OUTPUT_UNIT,FMT=*) 'ERROR: PRINT_MSG: wrong verbosity level' - IF (GWRITE_OUTLST) WRITE(UNIT=ILU, FMT=*) 'ERROR: PRINT_MSG: wrong verbosity level' + IF (GWRITE_STDOUT) THEN + WRITE(UNIT=OUTPUT_UNIT,FMT=*) 'ERROR: PRINT_MSG: wrong verbosity level' + FLUSH(UNIT=OUTPUT_UNIT) + END IF + IF (GWRITE_OUTLST) THEN + WRITE(UNIT=ILU, FMT=*) 'ERROR: PRINT_MSG: wrong verbosity level' + FLUSH(UNIT=ILU) + END IF END SELECT ! YSUBR=TRIM(HSUBR)//':' @@ -245,8 +263,14 @@ end if IF (KVERB<=IABORTLEVEL) THEN Write( yprcnb, '( i8 )' ) ip - 1 - IF (GWRITE_STDOUT) WRITE(UNIT=OUTPUT_UNIT,FMT=*) 'ABORT asked by application '//TRIM(CPROGRAM) - IF (GWRITE_OUTLST) WRITE(UNIT=ILU, FMT=*) 'ABORT asked by application '//TRIM(CPROGRAM) + IF (GWRITE_STDOUT) THEN + WRITE(UNIT=OUTPUT_UNIT,FMT=*) 'ABORT asked by application '//TRIM(CPROGRAM) + FLUSH(UNIT=OUTPUT_UNIT) + END IF + IF (GWRITE_OUTLST) THEN + WRITE(UNIT=ILU, FMT=*) 'ABORT asked by application '//TRIM(CPROGRAM) + FLUSH(UNIT=ILU) + END IF !Every process write on the error unit. This is necessary if the abort is done by an other process than 0. WRITE(UNIT=ERROR_UNIT,FMT="(A8,': ',A9,A30,A)") ADJUSTL(yprcnb),YPRE,YSUBR,HMSG WRITE(UNIT=ERROR_UNIT,FMT="(A8,': ',A)") ADJUSTL(yprcnb),'ABORT asked by application '//TRIM(CPROGRAM)