Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fortran runtime error: End of file.

Status
Not open for further replies.

chauhan91

Technical User
Oct 16, 2014
2
I am curretly working on a CFD code in which I am required to read a values of diameter from a file 'dialog4.dat' (generated by fortran) and transfer the diameters to an array 'dd1'. while running the code it gives the error "Fortran runtime error: End of file."
I am attaching a screenshot of the code with the error message.
Please help me to sort it out as I am running out of deadline.
 
 http://files.engineering.com/getfile.aspx?folder=0abbf18d-c851-49bc-aec7-4e02b3e740c4&file=59.png
Basically, there is insufficient data for dd1 in dialog4.dat. Remember that if you read in free format, there must be at least a space between the numbers. If the data was generated without any spaces between some of the numbers then you have to find out what format it was written in and use that format to read your data.

1) what is dd1 - how big is the array
2) how much data is there in the file dialog4.dat?
 
is it dialog4 or dialog006?

Basically, you need to make sure that dialog006.dat actually has the data you are planning to read, does it? can you open such file? is it plain text? is it a single line of numbers? how many?

 
@salgerman: ya it has the data (diameters of droplets having log normal distribution) and it's a .dat file and single line of numbers. I am attaching the file. You can check it.
@xwb: you can check the file I am attaching here. And the array dd1 is sufficiently big (aroound 20000).

You can open the file using Gedit editor or any other you prefer.
 
 http://files.engineering.com/getfile.aspx?folder=b9d19e0a-438c-4fb2-b63c-7e4c450ff193&file=dialog006.dat
I just opened the attached file...it does not look like it is a single line of numbers; instead, it very much looks like there is on number per line...and about 220,000 lines (not 20,000 as you mentioned).

So, I would suggest you be more explicit as to how you go about reading the data and how many items. The thing that when you attempt to read an array without specifying any indexing, Fortran will attempt to read as many items as it takes to fill up the entire array...what's the dimension of dd1?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top