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 Modern Fortran Programs

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

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

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.

I/O

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

Orderless loops

loop_forall.f95
FORALL construct
loopless_where.f95
WHERE construct

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

Control Structures

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

Process Environment

proc_args.f03
Command Line Arguments
proc_env.f03
Environment Variables

Misc

pointers_linked_list.f95
Pointers: Linked List
© 2009 Mitch Richling