Fortran Wiki
Code

Source Code on the Fortran Wiki

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.
  • ansi_colors - simple module illustrating how to produce ANSI color escape codes for terminal output.
  • asa2pdf - convert files using ASA carriage control to an Adobe PDF
  • 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.
  • differentiation - functions for numerical differentiation of arrays.
  • fdate - example use of date_and_time(3f)
  • File_Name_Generator - to whom bothering building a file name string with integer or using internal write
  • 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.
  • integration - functions for numerical integration of arrays.
  • interface_mod - an example of defining interfaces in a module.
  • internalproc - internal procedure example.
  • interpolation - functions for numerical interpolation of arrays.
  • jucolor(3f) - simple conversions between common color models
  • inv - matrix inversion via LAPACK.
  • kiss64 - a 64-bit random number generator by George Marsaglia.
  • kracken - a module for cracking command line arguments
  • m_time - a module for manipulating and formatting date and time values
  • 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
  • newunit - Joe’s 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
  • readline - example that reads a line of arbitrary length
  • regex_module - Interface to POSIX regex routines
  • roach(3f) - write large block letters
  • 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
  • f_uname - call uname(3c) using ISO_C_BINDING and a C procedure
  • ufpp - a Fortran pre-processor written in Fortran
  • writegif - writes an image into a GIF file.
  • what - The what(1) command re-implemented in Fortran
  • 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.
  • wc - a word count utility.
  • xxenv - example of accessing Environment Table
  • String_Functions - a module of string processing routines.

Code Available Elsewhere

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.

category: code