Fortran Solving Fortran Error on Linux: invalid number

AI Thread Summary
The discussion revolves around a user attempting to run Fortran code on Linux that was originally developed on Windows. The user encountered an error related to reading a data file, specifically "invalid number: incomprehensible list input," while trying to open a file named NUCLEAR.DAT. A suggestion was made to check if the program was failing at the file open operation or during reading, with a note that case sensitivity and end-of-file issues could be potential causes. Ultimately, the user resolved the issue by identifying that the NUCLEAR.DAT file contained virtual characters from its creation on Windows, which were eliminated using the sed command.
Norman
Messages
895
Reaction score
4
Hi all,

I am trying to run some fortran code on Linux that was originally written (and worked) on Windows.

I am getting the following error:

invalid number: incomprehensible list input
apparent state: unit 63 named NUCLEAR.DAT
last format: list io
lately reading sequential formatted external IO
Aborted

I was in the process of changing a statement OPEN(100, FILE='NUCLEAR.DAT', STATUS='OLD') to OPEN(63, FILE='NUCLEAR.DAT', STATUS='OLD') since I know that g77 doesn't like numbers greater than 99 for unit numbers (as a default). Anyone know what this error means?
Thanks,
Ryan
 
Technology news on Phys.org
< guess >
Is the prgm reading any of the file or does it bomb at the open ? If it starts reading the file and bombs at the end you may have an invalid eof in the NUCLEAR.DAT file. Another thing it could be is case sensitivity. I've never seen the error and I port codes between pcs and various flavors of UNIX (including g77 and g95 on linux) routinely.
< /guess >
 
I figured it out. The .dat file was created in Windows and it had virtual characters in it. I just had to run sed to get them out of it. Thanks for the help.
Cheers,
Ryan
 
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 have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...

Similar threads

Replies
2
Views
2K
Replies
5
Views
5K
Replies
5
Views
2K
Replies
2
Views
3K
Replies
6
Views
3K
Replies
2
Views
9K
Replies
5
Views
3K
Back
Top