Troubleshooting Incomprehensible List Input in Fortran 77 Program

  • Context: Fortran 
  • Thread starter Thread starter snowdrop
  • Start date Start date
  • Tags Tags
    Input List
Click For Summary
SUMMARY

The forum discussion addresses an error encountered while running a Fortran 77 program compiled with g77, specifically the "invalid number: incomprehensible list input" error. The issue arises during internal I/O operations when reading a list of data files. The solution involves ensuring that character strings in the data file are enclosed in quotes or using a formatted read with the 'A' format specifier to correctly read the character data without quotes.

PREREQUISITES
  • Understanding of Fortran 77 syntax and structure
  • Familiarity with g77 compiler and its functionalities
  • Knowledge of internal I/O operations in Fortran
  • Experience with formatted and list-directed I/O in Fortran
NEXT STEPS
  • Learn about Fortran 77 character data handling
  • Research formatted I/O operations in Fortran
  • Explore error handling techniques in Fortran programs
  • Investigate best practices for file input/output in Fortran
USEFUL FOR

Fortran developers, programmers troubleshooting I/O errors, and anyone working with legacy Fortran 77 codebases.

snowdrop
Messages
1
Reaction score
0
Hi all,

I am trying to run a fortran 77 program which was compiled using g77 and it comes up with the following error ::

invalid number: incomprehensible list input
apparent state: internal I/O
lately reading sequential formatted internal IO
Abandon


:confused:

I want the program to read some data files and analyse them so I have written the list like this ::

file01.dat
file02.dat
file03.dat
file04.dat

I have no idea why this error is coming up... I have checked the program and he seems fine and I have declared the list in the declarations. The part of code used to open the file with the list of data files is the following ::

open (20,file=liste(1:lliste),form='formatted',status='old')

If anyone has any ideas what the problem could be.. :frown:

Thanks in advance :bugeye:
 
Technology news on Phys.org
The error message is about a read statement, not an open statement. If says the data in the file was in the wrong format.

If you want to do read character strings with list-directed I/O like

character*50 liste
read(*,*) (liste)

then the character strings in the data file must be in quotes

'file1.dat'
'file2.dat'
...

To read character data without the quotes, do a formatted read using A format:

read(*,'A') (liste)
 

Similar threads

  • · Replies 25 ·
Replies
25
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 33 ·
2
Replies
33
Views
3K