When contributing code, please specify a license so that others know the extent to which they may use and modify your code. All code on the Fortran Wiki shall be in the public domain unless otherwise noted. Other common licenses are the BSD, MIT, and GPL licenses.
To contribute Fortran source code, add a link here to the filename, program, or module name, and create the new page by pasting the code, wrapping it in a fenced code block with a language keyword. See the HowTo and existing pages such as hello for examples.
allocate_coin_toss - dynamic memory allocation example.
c_interface_module - supplemental types and functions for ISO-C-Binding
d2u(1f) - example of stream I/O; this program converts clear ASCII text files between Unix and DOS line terminator conventions.
fdate - example use of date_and_time(3f)
gen_list - a generic linked list example.
getopt_long_module - Fortran equivalent of C getopt_long
hash table example - an example implementation of hash tables.
hello - hello, world in Fortran 90.
init_seed - random number generator seeding example.
interface_mod - an example of defining interfaces in a module.
internalproc - internal procedure example.
jucolor(3f) - simple conversions between common color models
inv - matrix inversion via LAPACK.
kiss64 - a 64-bit random number generator by George Marsaglia.
match_wild - wild-card string matching
mm_ioutils - a library for easier I/O in Fortran.
notab(3f) - expand tab characters in input lines
notopen(3f) - find unused file unit number
opover - simple example of operator overload
pointer_example - an example of pointer usage.
iso_readline(3f) - calling the GNU C routine readline(3c) using the Fortran 2003 iso_c_binding module.
proc_component_example - procedure component example.
qsort_inline - a fast inline quick+insertion sort
read_gif - reads GIF file into array
regex_module - Interface to POSIX regex routines
stderr(3f) - example of writing to “stderr”
strnum - example illustrating conversion of numeric values to strings and vice-versa.
strtok(3f) - read tokens from a line in a manner similar to the C routine strtok
ttee - a “timed tee” – write stdout to stdin and another file with an optional date/time prefix.
transfer_ex - example of the transfer intrinsic.
use_test - an example of nested use statements
writegif - writes an image into a GIF file.
happy_new_year - Write happy new year and example of transfer
Quartiles - Calculating Quartiles in Fortran in 3 different method.
SVD - Program computes the matrix singular value decomposition
Time In Words - Program displays time in words
Validate Credit-Debit card number program - Fortran code to Validate Credit/Debit card number program
Reading Ansys Sub Structure analysis file Reading Stiffness/Mass matrices from Ansys Sub Structure Analysis output file.
This section lists individual modules, programs, and procedures, typically single files or perhaps zip files. See the Libraries page for more comprehensive collections of routines.
convert.f90 - converts FORTRAN 77 source form to Fortran 90 source form.
gen_ll.f90 - a generic linked list module by Roger Young and Peter McGavin.
roman_numerals.f90 - a Roman numerals module.
qsort_c.f95 - a recursive Fortran 95 quicksort routine.
RadixSort.f90 - radix sort in Fortran 90.
wc.f90 - a wc-like word count utility.
fscheme_mod.f95 - an embeddable Scheme interpreter (with bindings for the Japi GUI toolkit).
Fortran with Excel -A gfortran example to call fortran from excel
How to Create Fortran DLL in Visual studio - A google powerpoint presentation on how to create a fortran DLL with Intel Compiler in Visual Studio 2005/2008
Binary STL file reader in fortran Binary STL file reader in fortran
Quine in fortran 90 While Fortran has been thought to develop scientific applications, it can also be used for programmer amusement, here is a nice quine written in Fortran. A quine is a computer program which takes no input and produces a copy of its own source code as its only output.
Let It Snow in Fortran Inspired by google’s let it snow, this is let it snow animation in fortran using pgplot graphics library.
Value of PI by Monte Carlo Method Fortran code to determine the value of PI using Monte Carlo Method.
How to use Pgplot graphics library to create Fortran graphic programs?
Fireworks animation in Fortran Fireworks animation using Fortran PGPLOT libraries.
Heart in Fortran Generating Heart with Fortran code using pgplot.
ogpf An object-based Fortran 2003 / 2008 interface to gnuplot.
Hermite Polynomial Fortran module to generate hermite polynomials
Random number generator codes in fortran for probability distribution Fortran module to generate non-uniform random numbers