fortran error I/O
- by jpcgandre
I get this error when compiling:
forrtl: severe (256): unformatted I/O to unit open for formatted transfers, unit
27, file C:\Abaqus_JOBS\w.txt
The error occurs in the beginning of the analysis.
At the start, the file w.txt is created but is empty. The error may be related to the fact that I want to read from an empty file.
My code is:
OPEN(27, FILE = "C:/Abaqus_JOBS/w.txt", status = "UNKNOWN")
READ(27, *, iostat=stat) w
IF (stat .NE. 0) CALL del_file(27, stat)
SUBROUTINE del_file(uFile, stat)
IMPLICIT NONE
INTEGER uFile, stat
C If the unit is not open, stat will be non-zero
CLOSE(unit=uFile, status='delete', iostat=stat)
END SUBROUTINE
Ref: Close multiple files
If you agree with my opion about the cause of the error, is there a way to solve it? Thanks