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 me out on Facebook

Example FORTRAN 77 Programs

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. The makefile is here.

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

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"

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"

Subroutines & Functions

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

Arithmetic

arith.f
Illustrates some arithmetic concepts in FORTRAN

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

Control Structures

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

Hello World!

hello.f
A simple hello world program!
© 2009 Mitch Richling