Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29265 Discussions

forrtl: severe (24): end-of-file during read

mechprog
Beginner
24,819 Views
I have found a few Fortran forum posts on this problem above, however all the posts were closed, so I could not post my question there. Therefore I started a new post. I am receivingthe error message and despite trying to get rid of it, still no success, can anyone help. Thanks.

forrtl: severe (24): end-of-file during read, unit 15, file C:\\analysis\\doc.txt

Image PC Routine Line Source
libifcoremd.dll 00000000100BE430 Unknown Unknown Unknown
libifcoremd.dll 00000000100B7F75 Unknown Unknown Unknown
libifcoremd.dll 00000000100A4F8B Unknown Unknown Unknown
libifcoremd.dll 0000000010025470 Unknown Unknown Unknown
libifcoremd.dll 0000000010024E3D Unknown Unknown Unknown
libifcoremd.dll 0000000010057B2B Unknown Unknown Unknown
standardU.dll 0000000007E611C9 Unknown Unknown Unknown
ABQSTD_Core.dll 0000000180ACCEFD Unknown Unknown Unknown
ABQSTD_Core.dll 0000000180ACAF82 Unknown Unknown Unknown
ABQSTD_Core.dll 000000018088CCAF Unknown Unknown Unknown
ABQSTD_Core.dll 00000001805B9582 Unknown Unknown Unknown
ABQSTD_Core.dll 0000000180380444 Unknown Unknown Unknown
ABQSTD_Core.dll 00000001802163EA Unknown Unknown Unknown
ABQSTD_Core.dll 00000001801022DC Unknown Unknown Unknown
ABQSTD_Core.dll 000000018006D39E Unknown Unknown Unknown
ABQSTD_Core.dll 0000000180031C7E Unknown Unknown Unknown
ABQSTD_Core.dll 0000000180017220 Unknown Unknown Unknown
ABQSTD_Core.dll 000000018000B4C4 Unknown Unknown Unknown
standard.exe 0000000140002774 Unknown Unknown Unknown
standard.exe 000000014000184F Unknown Unknown Unknown
standard.exe 00000001400011B2 Unknown Unknown Unknown
kernel32.dll 0000000076EE652D Unknown Unknown Unknown
ntdll.dll 000000007711C521 Unknown Unknown Unknown

0 Kudos
23 Replies
TimP
Honored Contributor III
23,422 Views
On the face of it, we can't tell you much except that your program has run out of data unexpectedly while reading a file. If it's your own code, you should put in iostat clauses and the like in your OPEN and READ with messages to tell you whether the file is found, report how much was read, what was last read, .....
0 Kudos
mecej4
Honored Contributor III
23,422 Views
You can obtain a more useful stack trace, in terms of line-numbers, if you recompile using the -traceback option. You can then examine the READ statements that are so exposed to determine why the program ran out of data.
0 Kudos
mechprog
Beginner
23,423 Views
Thanks for your response, firstly I have tried addingthe followingIOSTAT code as suggested, but I still recieve the same error messages.

[fxfortran]      open(UNIT=t,FILE='C:analysisdocwrite.txt',STATUS='OLD',
     $IOSTAT=ios, FORM='FORMATTED') 
      IF (ios.NE.0) PRINT*, ios[/fxfortran]

Secondly, I could not find much useful information regarding traceback, only on the following link:

http://software.intel.com/sites/products/documentation/hpc/compilerpro/en-us/fortran/lin/compiler_f/bldaps_for/common/bldaps_use_trcback.htm

How with this help me to solve my problem?

Thanks.
0 Kudos
TimP
Honored Contributor III
23,423 Views
If you're not getting an error on the open, it tends to confirm that your program made it to a read and failed there. If you had multiple read statements, activating the traceback should help you determine which one was active at failure, in advance of adding an iostat and other diagnostics there.
You're quoting a Windows style path and shared library names but posting on the linux forum. Actually, traceback without running under debugger tends to be more reliable on Windows, so the advice you got here shouldn't be wasted.
0 Kudos
mechprog
Beginner
23,423 Views
Hi thanks, for your input, I am not sure how to use tracebacks? Can you point me towards some information where I can learn more about how to use this and any other information that may help me to solve my problem.

P.S. Yes I accidently posted on the linux forum instead of the Windows, but couldn't move it after. If you could move it to the Windows forum, that may be useful for others in the future trying to solve similar issues. Thanks.
0 Kudos
mecej4
Honored Contributor III
23,423 Views
It is beneficial to consult the Intel Fortran User Guide.

Syntax

Linux and Mac OS X:

-traceback

-notraceback

Windows:

/traceback

/notraceback

Arguments

None

Default

notraceback

No extra information is generated in the object file to produce traceback information.

0 Kudos
mechprog
Beginner
23,423 Views

By reading the through the Intel Fortran Comilers, it seems that the traceback option is used by typing a command into the command window however, I do not have an executable as I am only building a user defined subroutine to be used with Abaqus. I am still not sure how traceback will help me to solve this problem. I am posting to find some more inspiration, the fortran world is much lonelier than I expected... :-( (expect for this forum of course :-))

0 Kudos
mecej4
Honored Contributor III
23,423 Views
> I do not have an executable as I am only building a user defined subroutine > to be used with Abaqus.

This is the first mention of Abaqus in this thread. In your situation I would write a small driver (main program) to call the subroutine in the same way that Abaqus does (I don't use Abaqus).

Compile and run the program consisting of the driver and the subroutine outside of Abaqus and debug it. Then, when it is working properly, hook it up to Abaqus.
0 Kudos
mechprog
Beginner
23,423 Views
That's a good idea mecej4 thanks,

I am not sure if I would CALL my subroutine as a subroutine in the small driver (main program) or do this in some other way?

Note: that the current Abaqus subroutine calls a number of other abaqus based subroutines and utilities. Therefore I am not sure if this will cause a bunch of problems, as it relays on a bunch of inputs/links with abaqus.
0 Kudos
mechprog
Beginner
23,423 Views
Hello all,

I am really in need with some help with my fortran code to be used with Abaqus. I have tried so many things to overcome this problem, however, I still can not solve this. I have tried to include the following code, this prints out "something is wrong" in a continuous loop in status file when running the analysis and this ends with an error. Does anyone have any further suggestions on this? I have spent so much time over the problem... thanks.

[fxfortran]      open(UNIT=u,FILE='filename',STATUS='REPLACE',
     $ FORM='FORMATTED')
C
C   Read the number of points 
C
      do i=1,rtun  
         read(r,1000,IOSTAT=ios) jslnodes(i)
           If (ios.Ne.0) Then
             Write(*,*) 'Something is wrong'
             Exit
           End if
      enddo[/fxfortran]
0 Kudos
TimP
Honored Contributor III
23,423 Views
How does this differ from your expectation? You open and clear out a file, as if you intended to write to it, then attempt to read data from it. You might report at least on whether ios indicates an attempt to read past the end or some other error.
0 Kudos
IanH
Honored Contributor III
23,423 Views
Note that you are opening unit "u" and reading from unit "r". Is that intentional?

You've probably read more data than is in the file. As Tim posts - what's the value of ios when it first goes non-zero? What's the value of i at that time? What is in "filename". Does it have "rtun" lines in it (each read pulls in a complete record which is equivalent to a line for a formatted file)? Does each line have a constant that suits the type of jslnodes (integer if it is implicitly typed)? What is the format statement referred to with statement label 1000? Does it have a data edit descriptor that suits the type of jslnodes?

0 Kudos
DavidWhite
Valued Contributor II
23,423 Views
It would be helpful if you print the value of ios, as this will tell you what the error is.

However, a couple of observations:
1. Is this the acutal code, or an example, is your data file called 'filename' or something else. You should have the full page and name of the file in the open statement.
2. If you are only reading the file, why have you got the STATUS='REPLACE', as this would suggest you are
going to write to the file, replacing the original.
3. If this is the real code, not an example, you open unit number "u", but are reading from unit number "r". These should be the same unit number.

Can you please post the full code you are using, otherwise we are guess as to the real cause of the problem.

Regards,


David
0 Kudos
mechprog
Beginner
23,423 Views
Dear IanH,

I am very sorry for rating your reponse, I pressed the star by accident whilst reading itand could not change it after.If the administrators can remove the 1star, please do.I rate your response very highly and appreciate it very much.

I well get back to you all ASAP on your comments. Many Thanks.
0 Kudos
mechprog
Beginner
23,423 Views
TimP, thanks for your input. Your are correct, I have changed this from "REPLACE" to "OLD" to avoid clearing out the file (my mistake).

I am not familar with IOSTAT, so I am learning as I go along as to how it is going to help me solve this and future problems.
0 Kudos
mecej4
Honored Contributor III
23,423 Views
> I am not familar with IOSTAT, so I am learning as I go along as to how it is going to help me solve this and future problems.

There is no need to explore and stumble in the dark. The compiler documentation contains a table of IOSTAT values, equivalent symbolic constants, and the longer string describing the significance of each I/O error.
0 Kudos
Wendy_Doerner__Intel
Valued Contributor I
23,423 Views
I looked into it and we can not change the star rating once you have set it. We did submit our star rating to try increase it.

------

Wendy

Attaching or including files in a post

0 Kudos
JohnNichols
Valued Contributor III
23,394 Views
Dear Programmer:

To comment on some of your problems:

1. You are correct, whilst there are a lot of Fortran programmers, the only place you will get decent support is here. At least you found here.
2. Which version of Abacus are you using and on what type of machine? Abacus is only an inversion machine, can you not use any of the other excellent structures programs.
3. You are reporting an error that is similar to one I had fun with last week.

Can I suggest:

1. You confirm that your file is reading in a set of integers representing nodes.
2. You provide the exact code, I can assure you that no one here will steal it, merely it will give us a better idea of what you are doing.
3. You use numbers for your units.
4. Your iostat points to a line in the program outside your do loop so that we can see when it stops.
5. You reflect evey read line to the screen before you read the next line.
6. you use debugging and single step through the code watching the values of the variables.
7. You use the standard math technique of halving your input and seeing if that works. Repeat until you find the problem.
8. You read the data into Excel and make sure there are no characters in it.
9. Buy a case of beer and drink two of them slowly, then reconsider the problem. If you are to young for beer. let us know and we will do that step for you.




Regards

John Nichols
0 Kudos
mechprog
Beginner
23,423 Views
Hi everyone,

1. For sure, the help and support on this forum is some of the best I have experienced on the internet.
2. Are you think about the same Abaqus? I am referring to SIMULA Abaqus Finite Element Analysis Engineering software
3. "Fun" is one way of describing it :-)

Thanks for everyone advice and tips, I have tried to incorporate all that I can.I can incorporate all of it, as I am not writing a full program, but rather a Fortran subroutine to be used with an analysis. You comments regarding confidentiality is much appreciated, I have always felt this forum to becompletely professional.

I have uploaded the code and Nodesdoc_test file to this post, see link below. I look forward to any feedback and advice. It's been a steep learning curve, hope that I manageif it gets steeper ;-)

Thank-you all.
0 Kudos
IanH
Honored Contributor III
20,369 Views
You've got all the numbers on one line. Each READ statement (without an ADVANCE specifier) reads in a complete "record". For formatted (text) files, a record is equivalent to a line. The read statement will pull in the whole line, and then guided by its list of io-items (of which there is only one - "jslnodes(i)") and its format, convert the first four characters to a integer, store that in jslnodes(i), and then discard the rest of the line. Because there's only one line, the next trip through the do loop, you hit end of file!

Note that the format for the read "(I4)" says to get a single integer from a field that is four characters wide. It doesn't say anything about using the comma as a separator - which is what your input file is using - so you've got a mismatch there too.

And finally nmax is 117, but you've only got 63 numbers in the file.

So either your input file needs to change to match the code, or your code needs to change to match the input file, or a bit of both.

If you want to stick to the comma separated line you might be able to get away with list directed formatting (use a * for the format). There are some downsides, as the rules for what is valid input under list directed formatting are quite loose, so errors in the input may go undetected or some forms of input may not be translated quite as you'd expect. Most of the time that means that you are better off using an explicit format, perhaps with some parsing code to handle things like use of a comma as a separator. But as an example:

[fxfortran]      PROGRAM LookMumICanRead      
        IMPLICIT NONE      
        INTEGER, PARAMETER :: u = 55
        INTEGER, PARAMETER :: nmax = 63
        INTEGER :: jslnodes(nmax)
        INTEGER :: i
!****        
        OPEN( UNIT=u, FILE='Nodesdoc_test.txt', ACTION='READ', 
     +      STATUS='OLD' )      
        READ (u,*) jslnodes(:nmax)        
        DO i = 1, nmax
          PRINT "(I0,':',T5,I0)", i, jslnodes(i)
        END DO        
        CLOSE(u)      
      END PROGRAM LookMumICanRead[/fxfortran]
This uses F90 array syntax and type declarations, just to balance the archaic fixed form source.

(Don't worry about the stars - I don't collect them...)

0 Kudos
Reply