Fortran What does errorfmt mean when running Fortran g77 code?

  • Thread starter Thread starter donnacom
  • Start date Start date
  • Tags Tags
    Code Fortran
AI Thread Summary
The discussion revolves around a Fortran 77 code compilation issue using g77, where an error occurs during execution related to an input READ statement. The error message indicates a mismatch between the format specified in the code and the actual input data being read. One participant suggests a method to debug the issue by inserting print statements after each READ command to identify which specific statement fails. This approach helps isolate the problem, leading to the discovery that changing the format from (10X,D13.7) to (20X,D13.7) resolves the error, allowing the program to run successfully.
donnacom
Messages
3
Reaction score
0
Hi,
I received a code written in Fortran 77, and I am trying to compile it and run it using g77. It compiles easily with no errors, but I keep getting the following error when I execute

errorfmt: read unexpected character
apparent state: unit 5 named jeffin
last format: (10X,D13.7)
lately reading sequential formatted external IO
Aborted

Any idea what this error means?
 
Technology news on Phys.org
It looks to me like your error is coming from an input READ statement where the format string is in disagreement with what your program is trying to read.

I can't say any more than that because I don't see your code and I don't know what the input was.
 
Sorry, here are the codes I used in the zipped folder. The code JEFF.FOR compiles fine, but I cannot find an error in how the read command takes in the input file called jeffin. If you can help me out, I would really appreciate it!
Donna
 

Attachments

In principle, it's possible to figure out which of your READ statements is failing, by tracing through the code carefully by hand, one statement at a time, and matching each READ statement with a line in your input file to see if the format matches properly.

However, it's easy to make mistakes doing this. Instead, get the computer to do the work for you! :smile:

Immediately after each READ(5... statement, insert a statement which displays the value that it just read in. For example, after

READ(5,99)NEIGEN

add

PRINT *, "NEIGEN = ", NEIGEN

If the appropriate line in your input is actually being read properly, you should see the message

NEIGEN = 2

The last such output line before the error message will tell you which READ statement failed... it's the next one!
 
Thanks!
This really helped. I found the error. I had the format 102 written as (10X,D13.7) and when I put instead (20X, D13.7) it runs.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...

Similar threads

Replies
2
Views
2K
Replies
8
Views
4K
Replies
16
Views
2K
Replies
2
Views
3K
Replies
7
Views
4K
Replies
6
Views
3K
Replies
4
Views
2K
Replies
6
Views
4K
Back
Top