Compling of Fortran file aborted

In summary, the user ran into an error when trying to transfer data1 from the input file into the output file. The user attempted to solve the problem by adding a newline to the end of the data file, but this did not work. The user then contacted the author for help and the author provided a solution that involved reducing the number of data read from 400 to 395, opening a file and reading from it, or copying data from Excel and pasting it into a new text editor before sorting it.
  • #1
jam_gha
7
0
Hi

I want to sort the data in output file by Fortran transfer file.
when I do ./transfer<output>data1
It gives an error message:
invalid number: incomprehensible list input
apparent state: unit 5 (unnamed)
last format: list io
lately reading direct formatted external IO
Aborted
can anybody help me?

thank you
jamshid
 

Attachments

  • fortran.zip
    1.6 KB · Views: 167
Technology news on Phys.org
  • #2
It looks to me that the data file has not been closed correctly. All you need to do is to add a newline to the end of the data file to complete the 80th line and the program should work as posted.
 
  • #3
I add a new line to the end of my data and then I compile it . it give same error again.
 
  • #4
I ran the program below and it compiled, and ran correctly.

Code:
      program transfer
      dimension de(400)
C      DO 5 I=1,400,5
C    5 read(*,*)(de(j),j=I,I+4)
      read(*,*)(de(j),j=1,400)
      do 10 i=1,400
      write(6,*) i,de(i)
   10 continue
      end

If it is a compilation error, could you indicate the operating system and the compiler's name? Also please indicate if it is F77, F90 or F95.
A compilation should occur before you type ./transfer <output >data1
Also, double check that the executable created is called transfer.exe and not a.out or anything else.
If it is an execution error, you can also modify the code to read 5 numbers per read (80 lines total). Make sure that you have added a newline to the end of the DATA and not the program.
 
  • #5
I ran your commands and it produced an executable file as did for me.
I add a line to end of my data as you told, unfortunately, it give error messages:
invalid number: incomprehensible list input
apparent state: unit 5 (unnamed)
last format: list io
lately reading direct formatted external IO
Aborted
For your information, my operation system is Linux fedora 10, 64*84 and my Fortran compiler are g77 and f77.
I am waiting for your new comment.
thanks
jamshid
 
  • #6
> ... it produced an executable file ...
Thank you for confirming that the compilation went through with no problem, which infers that the problem is execution.

> ... apparent state: unit 5 (unnamed) ...
Traditional Fortran (F77 and before) uses unit 5 for input. Some compilers accept read(*,*) statements and assign unit 5 automatically. As I do not use g77, I cannot confirm if this applies to g77.

To solve your problem, you have three possibilities, in this order:
1. change the read(*,*) to read(5,*) and see if it solves the problem.
2. If the above does not work, then replace the read statement by uncommenting the two commented lines (do 5...).
Sometimes the compilers get bogged down because of newlines not being at the right places. The commented lines read the lines correctly.
2a. If 2. above does not work, reduce the number of data read from 400 to 395. This will avoid reading the last line and hence any problem associated with it.
3. Open a file and read from the file (for example, using unit1 instead of 5), but the execution line will not require the <output parameter, i.e. just ./transfer >data1.

Let me know how it goes.
 
  • #7
Thank you
this time it is working.
 
  • #8
Good to hear that.
If it is possible at all, could you tell me what changes you made to get it to work?
 
  • #9
there was extra line in data and then I copied data in excel and then paste in new text editor. then I sort the data after that I compile it.
thanks for your help.
 

Related to Compling of Fortran file aborted

1. What does "Compling of Fortran file aborted" mean?

When you see the message "Compling of Fortran file aborted" it means that the compilation process for a Fortran file has been stopped or terminated before it could be completed. This could be due to errors in the code, missing dependencies, or other issues.

2. Why did my Fortran file fail to compile?

There are several reasons why a Fortran file may fail to compile and result in the message "Compling of Fortran file aborted". Some common reasons include syntax errors in the code, missing or incorrect library or module dependencies, or issues with the compiler itself.

3. Can I fix the compilation error and continue the process?

Yes, in most cases, you can fix the error that caused the compilation to be aborted and continue the process. You will need to identify the specific error and make the necessary changes to the code or dependencies. Once the issue is resolved, you can attempt to compile the Fortran file again.

4. How can I prevent "Compling of Fortran file aborted" from happening?

To prevent this error from occurring, it is essential to thoroughly test and debug your Fortran code before attempting to compile it. This includes checking for syntax errors, ensuring all dependencies are correctly included, and testing the code on a smaller scale before attempting a full compilation.

5. Is there a way to recover a partially compiled Fortran file?

In some cases, it may be possible to recover a partially compiled Fortran file. This will depend on the specific error that caused the compilation to be aborted. If the error is related to a specific line or function, you can try commenting out that section and recompiling. If the error is due to missing dependencies, you can try adding them and recompiling. However, sometimes the best solution is to start from scratch with a clean and properly functioning Fortran file.

Similar threads

  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
12
Views
2K
  • Programming and Computer Science
Replies
4
Views
3K
  • Programming and Computer Science
Replies
29
Views
2K
  • Programming and Computer Science
Replies
2
Views
3K
  • Programming and Computer Science
3
Replies
75
Views
4K
  • Programming and Computer Science
Replies
3
Views
2K
  • Programming and Computer Science
Replies
6
Views
2K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
11
Views
2K
Back
Top