Skip to content
Snippets Groups Projects
Commit 49b1b4aa authored by ESCOBAR Juan's avatar ESCOBAR Juan
Browse files

Juan 14/03/2022:SURCOUCHE/mode_msg.f90, add FLUSH in print_msg

parent 8f06417c
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment