Jump to my Home Page Send me a message Check out stuff on GitHub Check out my photography on Instagram Check out my profile on LinkedIn Check out my profile on reddit Check me out on Facebook

Mitch Richling: Example FORTRAN 77 Programs

Author: Mitch Richling
Updated: 2023-11-15

Table of Contents

1. Introduction

Did someone just ask you to update a 30 year old FORTRAN 77 program? If so, then you may be in the right place. Here you will find several small, but complete, FORTRAN 77 programs illustrating many common language concepts and constructs. The intent is to give programmers with no FORTRAN 77 experience a core set of fundamental examples to help them get up to speed quickly on this venerable language. If you really want to become an expert FORTRAN 77 programmer, then the best way is to look at quality code – check out the BLAS and LAPACK for a start. Good luck.

Get it all on github: https://github.com/richmit/ex-f77/

2. Variable Declarations & Types

types.f
How to explicitly declare variable types
implv.f
How to use the rather dubious implicit variable type features of FORTRAN
implml.f
Demonstrates the "IMPLICIT NONE" statement specified in MIL-STD-1753

3. Various "Variable" Topics

array.f
How to declare and use arrays
arrsub.f
Arrays and subroutines
parm.f
Parameter "variables"
datas.f
The "data" statement used to initialize variables.
coms.f
Common blocks
chars.f
Character "strings"

4. I/O

io.f
Simple console I/O
fileio.f
Simple file I/O
fmtio.f
Formatted I/O
intFil.f
How to use "Internal Files"

5. Subroutines & Functions

statf.f
One line functions
func.f
Regular functions
subs.f
Subroutines
savey.f
Demonstrates the SAVE statement

6. Arithmetic

arith.f
Illustrates some arithmetic concepts in FORTRAN

7. Loops

do.f
The FORTRAN 77 do loop
loopsg.f
FORTRAN 77 looping constructs
goto.f
Simple GOTO – infinite loop
loopml.f
Nonstandard, but common, loop construct specified in MIL-STD-1753

8. Control Structures

ifth.f
If-Then and all of its little buddies!

9. Hello World!

hello.f
A simple hello world program!