0

I am trying to run some old fortran f77 codes. I somehow managed to compile and got the executable. But when I run the executable I am getting the following error.

fmt: end of file
apparent state: unit 14 named sol2
last format: (3i10)
lately reading sequential formatted external IO
Aborted (core dumped)

I looked online for similar errors, and most of the solutions are pointing towards FORMAT statement and edit descriptors.

So I gone through all the source files and figured out the exact location and file where I have the 3i10 descriptor statement.

Below is the portion where I have 3i10 descriptor followed by few lines of code. Sorry I can't put the whole code since its very long. But, in the whole code this is the only place where I have 3i10 descriptor.

     SUBROUTINE READ(UNIT_LOC, NCOMP_LOC, 
    &               NSP_LOC, 
    &               NP_LOC)
     IMPLICIT NONE       
     INCLUDE '../SOURCES_COUNTERFLOW/unsteadyf_inc.h'
     INTEGER  UNIT_LOC, NCOMP_LOC, NSP_LOC, NP_LOC
     OPEN (UNIT=UNIT_LOC,FORM='FORMATTED',FILE=NAME_LOC)
     READ(UNIT_LOC,100) NCOMP_LOC, NSP_LOC, NP_LOC
100  FORMAT(3I10)
1004 format(100(1PE13.5,1X))

By reading online solutions, I tried changing the FORMAT to FORMAT(' ',3I10)``FORMAT(3I10.8) but no luck.

Any help is appreciated.

  • You have an error message "end of file", so you need to tell us about the file and how it is read. Note that neither of the input statements you show use the format labelled `100`. – francescalus Jan 07 '22 at 02:24
  • But those `READ` statements use format label 601. We need those that use 100, not those that use 601. We also need the declarations of the variables that will apoear in tye affected input lists. – Vladimir F Героям слава Jan 07 '22 at 07:57
  • Please edit the question to include the new information appropriately, don't put it in the comments – Ian Bush Jan 07 '22 at 08:12
  • @IanBush, please find the edited question which includes the READ statement that uses the format label 100. – Mohammed Niyasdeen Jan 07 '22 at 08:27
  • 2
    I think this is unanswerable. The error is `end of file`. You will have to check your input data and all the code that reads it. See [mcve]. Without that, you are likely on your own. – Vladimir F Героям слава Jan 07 '22 at 08:29
  • BTW note this is not Fortran 77 - it is at least Fortran 90. – Ian Bush Jan 07 '22 at 08:33
  • @VladimirF, I will check my input data and all the codes. Can you please tell me what is mean by `end of file`? – Mohammed Niyasdeen Jan 07 '22 at 08:57
  • It probably means you are trying to read more data than is actually in the file. – Ian Bush Jan 07 '22 at 09:10
  • @IanBush, Thanks for the comments and you are correct. This read statement code is Fortran 90 and so does the write statement code. I have a confusion related to f77 and f90 codes which I have asked as a separate question. Please check this link [link](https://stackoverflow.com/questions/70619453/is-there-any-common-fortran-compiler-for-both-f77-and-f90-codes). – Mohammed Niyasdeen Jan 07 '22 at 09:56

0 Answers0