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 Programs

Author: Mitch Richling
Updated: 2023-11-15

Table of Contents

1. Introduction

These small programs illustrate some of the new features in Fortran 90, 95, 2003, and 2008 from the perspective of a FORTRAN 77 programmer.

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

2. Variable Declarations & Types

variable_decl.f95
Variable specification (declaration)
real_kinds.f95
How to select single and floating point KINDS for real numbers
real_ieee.f95
How to select KINDS for IEEE floating point numbers
int_kind.f95
How to select various integer KINDS
int_kind_c.f03
How to select fixed size integers via C inter-op

3. Various Array Topics

array_dynamic.f95
Dynamic array allocation, use, and de-allocation
array_dynamic2.f95
Another demo of dynamic arrays
array_init1995.f95
Array assignment and declaration in Fortran 95
array_init2003.f03
Array assignment and declaration in Fortran 2003
array_linear_alg.f95
Some linear algebra related techniques
array_sections.f95
Array sections
array_reduction.f95
Array reduction (arithmetic and logical)
array_elemental.f95
ELEMENTAL functions and subroutines.

4. I/O

no_advance_print.f95
How to do non-advancing I/O
format.f95
Format statements

5. Orderless loops

loop_forall.f95
FORALL construct
loopless_where.f95
WHERE construct

6. Program Structure

prog_struct.f95
Typical program structure
mod_struct.f95
Typical module structure
overloading.f95
Function overloading
func_opt_arg.f95
Function optional arguments
func_recursive.f95
Direct recursion with a function

7. Control Structures

case_statement.f95
SWITCH CASE construct
loop_do.f95
DO loop construct

8. Process Environment

proc_args.f03
Command Line Arguments
proc_env.f03
Environment Variables

9. Misc

pointers_linked_list.f95
Pointers: Linked List