fortran error I/O

Posted by jpcgandre on Stack Overflow See other posts from Stack Overflow or by jpcgandre
Published on 2013-10-21T18:37:55Z Indexed on 2013/10/21 21:53 UTC
Read the original article Hit count: 226

Filed under:
|
|

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

© Stack Overflow or respective owner

Related posts about file

Related posts about io