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.
getopt_long_module - Fortran equivalent of C getopt_long
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.
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.
roman_numerals.f90 - a Roman numerals module.
wc.f90 - a
wc-like word count utility.
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.
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