Fortran Rules for Fixed Format Fortran: A Comprehensive Guide

AI Thread Summary
The discussion centers on the rules and style guides for fixed-format Fortran, particularly for file extensions such as .f77, .f, and .for. It highlights the structure of fixed-format Fortran, which includes specific column designations for comments, statement labels, continuation lines, and actual statements, all rooted in the limitations of punch card technology. The participants clarify that while the .f77 extension is commonly referenced, the rules apply uniformly across .f and .for files as well, emphasizing that the fixed format has been consistent since Fortran 66. The conversation touches on the historical context of these formats, noting that the 80-column limit is a remnant of punch card usage, and acknowledges the evolution of programming practices away from older technologies.
swartzism
Messages
103
Reaction score
0
Are there any rule guides on fixed format Fortran such as in .f77, .f, .for files? For example, http://www.physics.nau.edu/~bowman/PHY520/F77tutor/03_basics.html has a few snippets of rules for Fortran 77 such as

Col. 1 : Blank, or a "c" or "*" for comments
Col. 1-5 : Statement label (optional)
Col. 6 : Continuation of previous line (optional; see below)
Col. 7-72 : Statements
Col. 73-80: Sequence number (optional, rarely used today)​

I'm wondering if there are any style guides floating around out there governing all of these sorts of rules for fixed (and even free) format Fortran. Thanks in advance!
 
Technology news on Phys.org
I don't understand why you are calling that "a few snippets." This is a complete description of fixed-form Fortran.
 
Yes, but isn't that just for .f77? Do .f and .for have different rules?
 
swartzism said:
Yes, but isn't that just for .f77? Do .f and .for have different rules?
No. There is a single fixed format, which is a leftover from the punch card era.

The only time the extension is important is when it is something like .f90 or .f95, where free-form is assumed.
 
swartzism said:
Yes, but isn't that just for .f77? Do .f and .for have different rules?
The statement format in the OP has been used since at least Fortran 66. The 80 column width limit is predicated on what could be fit onto old-style punch cards, which were used at one time to store and then feed a Fortran source program into a computer.

A punch card:

ibm-80-column-punched-card1.jpg

A Fortran coding form:

FortranCodingForm.png


Ahhh... the good old days!
 
That's progress for you ! Much better than that damn flimsy old paper tape ... :rolleyes:
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
Thread 'Project Documentation'
Trying to package up a small bank account manager project that I have been tempering on for a while. One that is certainly worth something to me. Although I have created methods to whip up quick documents with all fields and properties. I would like something better to reference in order to express the mechanical functions. It is unclear to me about any standardized format for code documentation that exists. I have tried object orientated diagrams with shapes to try and express the...

Similar threads

Replies
6
Views
3K
Back
Top