Fortran What is meaning of (5,*), (6,*)and (*,*) in Fortran ?

  • Thread starter Thread starter masyousaf1
  • Start date Start date
  • Tags Tags
    Fortran
Click For Summary
SUMMARY

The characters "(5,*)" and "(6,*)" in Fortran represent standard file codes for input and output operations, respectively. Historically, file code 5 was used for reading from card input, while file code 6 was designated for printer output. In modern usage, file code 5 refers to reading from the terminal device, and file code 6 is for writing to the terminal device. The notation "(*,*)" allows for free-form input and output, enabling flexibility in data handling.

PREREQUISITES
  • Understanding of Fortran I/O operations
  • Familiarity with file codes in Fortran
  • Knowledge of terminal device interactions in programming
  • Basic comprehension of free-form data formatting
NEXT STEPS
  • Research Fortran I/O statement syntax and usage
  • Explore the differences between fixed and free-form formats in Fortran
  • Learn about terminal device handling in Fortran programming
  • Investigate historical context and evolution of Fortran file codes
USEFUL FOR

This discussion is beneficial for Fortran programmers, educators teaching Fortran, and anyone interested in understanding input/output operations in legacy programming languages.

masyousaf1
Messages
26
Reaction score
0
Dear Members,

Why The characters "(5,*)" should appear after every READ and the characters "(6,*)" after every WRITE ? What is the use of "(*,*)" that can appear with either the READ or WRITE statements.

Best Regards
 
Technology news on Phys.org
Filecode 5 was historically the standard card input for fortran and filecode 6 was for output to the printer.

Later 5 became read from the terminal device and 6 to write to the terminal device which then became using * as meaning read from or write to the terminal device. The second * is for a free form format for the day being read or written.
 
  • Like
Likes masyousaf1
jedishrfu said:
Filecode 5 was historically the standard card input for fortran and filecode 6 was for output to the printer.

Later 5 became read from the terminal device and 6 to write to the terminal device which then became using * as meaning read from or write to the terminal device. The second * is for a free form format for the day being read or written.

I think you mean 'the data being read or written.'
 
Thank you jedishfu for your prompt response. I just found the explanation for (*,*). If one wishes to use the write statement to write a statement to the default output, the syntax is write(*,*). SO the thread is closed now
 
Last edited:
Yeah thanks SteamKing I am sometimes a victim of the overzealous spell checker on my iPad and I often forget to check back because I know what I typed.
 
A Google search for "fortran read statement" gave me this nice summary as the very first hit:

http://www.oc.nps.edu/~bird/oc3030_online/fortran/io/io.html
 

Similar threads

  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 17 ·
Replies
17
Views
6K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 4 ·
Replies
4
Views
8K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
8K