Fortran Books

Become Proficient in Fortran with Free Books

Fortran Books

Fortran (Formula translation) is a multi-paradigm programming language invented by John Backus of IBM in the 1950s. It is particularly notable for innovation; it was the first high-level language, using the first compiler.

The language is designed to be simple to understand, yet retains the efficiency in execution as assembly language – about 80% as efficient as assembly/machine code. Fortran is machine independent, and a problem oriented language. It is often used in the scientific community, particularly among physicists, and is designed for scientific numerical computing. Fortran allows for high parallelization, it is easy to optimize, and lends itself particularly well to computationally intensive fields such as finite element analysis, numerical weather prediction, computational physics, computational chemistry, and computational fluid dynamics.

Fortran has evolved over time, with various standards including Fortran IV, Fortran 77, Fortran 90 and Fortran 95. More recent revisions are Fortran 2003, and Fortran 2008. Since Fortran 9x, it has many structured programming features, dynamic memory, operator overloading, and primitive objects. It is both the language of the past, the current, and the future (high-performance computing is unlikely to cast aside Fortran). Despite its age, Fortran is still very much alive and kicking. Fortran has a vast number of libraries of code.

We publish a series covering the best open source programming books for other popular languages. Read them here.

Interactive Fortran 77: A Hands on Approach

Interactive Fortran 77: A Hands on Approach

By Ian D Chivers, Jane Sleightholme (233 pages)

Interactive Fortran 77: A Hands on Approach introduces the reader to the concepts and ideas involved in problem solving with Fortran 77.

The authors stress the first stages of good programming practice, the accurate specification of problems, and well-organized program plans. Once these principles are defined, the main features of Fortran 77 are introduced. The emphasis throughout is placed on the need for a rigorous approach to algorithmic problem-solving, and the practical benefits to be gained from the adoption of a structured modular methodology.

Following introductory chapter, the book proceeds to cover:

  • Arithmetic – introduces the rules for the evaluation of an arithmetic expression, the idea of truncation and rounding of a number, the use of the PARAMETER statement and more
  • Arrays and DO loops (1) – introduces the ideas of tables of data, arrays, vectors, list and linear lists. It also introduces the twin concepts of data structure and corresponding control structure and more
  • Arrays and DO loops (2) – extends the ideas covered, and introduces an extended form of the DIMENSION statement, and the corresponding alternative form to the DO statement
  • Output; an introduction – introduces the facilities for producing neat output, and to show how to write results to a file, rather than to the terminal
  • Output; an extension – extends the ideas introduced concerning the production of neat output, and to provide an introduction to the power and capability of the layout or edit descriptors
  • Reading in data – introduces some of the ideas involved in reading data into a program such as integers, reals, and characters, READ and OPEN
  • Making decisions (1) – introduces selection between various courses of action as part of the problem solution and the concepts and statements in Fortran needed to support the above
  • Functions – introduces system supplied functions, user defined functions, and statement functions
  • Making decisions (2) – introduces the while loop and the repeat until construct
  • Error detection and correction – introduces some of the common ways that errors get into programs, and looks at some ways the computer can help detect and correct errors
  • Complex, double precision and logical – reviews real, integer and character variables, and examples other variable types, and introduces logical variables, hierarchy of operations, and the truth table
  • Characters – extend the ideas about characters, and demonstrates how this enables new problems to be solved
  • Subroutines – illustrates the use of subroutines, introduces a library of subroutines
  • Files – reviews the process of file creation, shows how files can be declared explicitly by the OPEN and CLOSE statements, introduces the arguments for the OPEN and CLOSE statements, and demonstrates the interaction between READ/WRITE and OPEN/CLOSE statements
  • Common and data statements – introduces an alternative way to communicate between program, subroutines, and functions
  • Optimisation – introduces some reasons for NOT optimising a program, and ways in which you can optimise a program
  • Problem solving revisited – draws together some of the ideas that have been presented regarding problem solving
  • Operating systems
  • Tools in programming

This book can be distributed in its entirety provided it is distributed as a whole with a copyright notice intact. This does not extend to hard copies.

Combinatorial Algorithms

Combinatorial Algorithms

By Albert Nijenhuis, Herbert S. Wilf (316 pages)

This book provides a set of Fortran subroutines for combinatorial algorithms in the spirit of numerical analysis packages.

The topics covered range from the random and sequential production of subsets, permutations, compositions, partitions, etc.; graph algorithms – finding spanning forests, chromatic polynomials, coloring, random trees, minimal length spanning trees, Euler and Hamiltonian circuits, etc.; finding Möbius functions, the permanent, maximal flow, sorting and some theoretical subjects. Some important subjects are omitted, such as testing for planarity, tree and graph isomorphism, connectivity of a graph, maximum matching, etc.

Each problem includes a theoretical background, an algorithm, a flowchart and a Fortran subroutine.

Reproduction of the downloaded version is permitted for any valid educational purpose of an institution of learning, in which case only the reasonable costs of reproduction may be charged. Reproduction for profit or for any commercial purposes is strictly prohibited.

Introduction to Programming using Fortran 95

Introduction to Programming using Fortran 95

By Ed Jorgensen (227 pages)

Introduction to Programming using Fortran 95 provides an introduction to programming and problem solving using the Fortran 95 programming language.

This introduction is geared for non computer science majors. As such, this book is not a complete, comprehensive guide to the Fortran 95 programming language. The primary focus is on an introduction to problem solving and algorithm development. As such, many details of the Fortran are omitted. The book includes quiz questions and suggested projects for the reader.

Chapters cover:

  • Fortran 95 Basic Elements – describes some of the basic elements of Fortran
  • Expressions – describes how to form basic Fortran 95 expressions and perform arithmetic operations
  • Simple Input and Output – simple, unstructured, input and output can be performed with the write and read statements
  • Program Development – understand the problem, create the algorithm, develop the program, and test/debug the program
  • Selection Statements – covers relational expressions, IF statements, create the algorithm, and more
  • Looping – looks at looping methods
  • Formatted Input/Output – FORMAT statement
  • Characters and Strings – examines Fortran’s extensive character and string handling capabilities
  • File Operations – allows Fortran programs to read from files and/or write to files
  • Single Dimension Arrays
  • Multidimensional Arrays – looks at this more advanced type of array
  • Subprograms – there are two types of Fortran subprograms: functions and subroutines
  • Derived Data Types – a user-defined combination of the intrinsic data types
  • Modules – provides a description of the formatting requirements and an example of how to set-up the modules
  • Recursion – examines this powerful general-purpose programming technique
  • Character String / Numeric Conversions
  • System Services

This book is released under the Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) license.

Professional Programmer's Guide to Fortran77

Professional Programmer’s Guide to Fortran77

By Clive G. Page (122 pages)

Professional Programmers Guide To Fortran 77 provides a comprehensive description of the features and implementation of Fortran 77. Ideal as a text from which to learn a second language, or as a reference guide to a first or main language.

Chapters include:

  • Basic Fortran Concepts – presents some of the basic ideas of Fortran by showing some complete example. Statements, Expressions and Assignments, Integer and Real Data Types, DO Loops, Formatted Output, Functions, IF-blocks, and Arrays are explained
  • Fortran in Practice – describes the steps required to turn a Fortran program from a piece of text into executable form. It covers creating source code, compiling, and linking
  • Program Structure and Layout – explains the rules for program construction and text layout
  • Constants, Variables, and Arrays – deals with the data-storage elements of Fortran: constants, variables, and arrays
  • Arithmetic
  • Character Handling and Logic – describes the facilities for handling non-numerical data in Fortran
  • Control Statements – includes IF-Blocks, DO-Loops, Logical-IF Statement, and more
  • Procedures – Intrinsic functions, Statement functions, External functions, and Subroutines
  • Input/Output Facilities
  • DATA Statement – used to specify initial values for variables and array elements
  • Common Blocks – a list of variables and arrays stored in a named area which may be accessed directly in more than one program unit
  • Obsolete and Deprecated Features
  • Common Extensions to the Fortran Standard

One of the attractions of using Fortran 77 is that Linux has an excellent open source compiler in the form of the GNU Fortran compiler, which is part of the GNU Compiler Collection (GCC).

Professional Programmers Guide To Fortran 77 is published under the GNU Free Documentation License Version 1.1.

Introduction to Computer Programming Using Fortran 95

Introduction to Computer Programming Using Fortran 95

By Dr Marshall, Helen Talbot, Neil Hamilton-Smith (82 pages)

Introduction to Computer Programming Using Fortran 95 is a student guide which introduces the reader to Fortran.

The book comes complete with questions to tax the budding Fortran developer.

Chapters cover:

  • Fundamentals of Computer Programming
  • Logical Operations and Control Constructs – includes control flow, IF statement, IF … THEN … ELSE construct, IF … THEN … ELSEIF construct, and more
  • Arrays – good coverage including array element ordering, array sections, array conformance, array syntax, functions (COUNT, SUM, MOD, MINVAL, MAXVAL, MINLOC, MAXLOC), Array I/O and more
  • Procedures – covers functions, subroutines, argument association, argument intent, local objects, SAVE attribute, scoping rules, dummy array arguments, external functions and more
  • Modules and Derived Types – plan geometry program, reusability- modules, restricting visibility, the USE Renames facility, USE ONLY statement, derived types, and true portability
Computational Physics: Programming in Fortran 95

Computational Physics: Programming in Fortran 95

By Dr. Rachael Padman (50 pages)

This is a primer for Fortran 95 starting with the very basics, before moving on to graphics and visualization. It also examines functions and subroutines, using modules, and numerical precision.

The book ends with sections on using the numerical library, NAG, and the case statement.

Fortran 90 for the Fortran 77 Programmer

Fortran 90 for the Fortran 77 Programmer

By Bo Einarsson and Yurij Shokin (82 pages)

Fortran 90 for the Fortran 77 Programmer is written in order to ease the transition from the very common and popular programming language Fortran 77 to the more modern Fortran 90. This transition uses the fact that Fortran 77 is a pure subset of Fortran 90.

Permission is granted to copy and/or print this hypertext as long as the copyright notice and this permission is included on all copies.

User Notes on Fortran Programming

User Notes on Fortran Programming

By Various (HTML)

User Notes on Fortran Programming concentrates on topics which are not discussed in ordinary Fortran courses and regular textbooks: good programming practices, and various technical and numerical issues.

The authors aim to provide a clear exposition of these topics as they are essential for good programming, especially for large programming projects.

Chapters cover:

  • Programming
  • Language topics
  • Tools
  • Floating point numbers
  • The environment

This book is an open cooperative practical guide which my be redistributed provided it’s kept updated, and all rights are reserved.

While not released under an open source license, Numerical Recipes in Fortran 77: Second Edition – Volume 1 – The Art of Scientific Computing and Numerical Recipes in Fortran 90: Second Edition – Volume 2 – The Art of Parallel Scientific Computing warrant a special mention.

PROGRAMMING LANGUAGE PROFILES

Ada, Awk, Assembly, Bash, C, C++, C#, Clojure, CoffeeScript, ECMAScript, Erlang, Forth, Fortran, Go, Haskell, HTML, Java, JavaScript, LaTeX, Lisp, Logo, Lua, OCaml, Pascal, Perl, PHP, Prolog, Python, R, Ruby, Rust, Scala, Scheme, Scratch, SQL, Swift, TeX, VimL

Leave a Reply