Home » Software » f90autodoc

f90autodoc

Fortran 90 code surely needs documentation. However, there are not that many free documentation generation tools like Doxygen for this language. This f90autodoc is an attempt to create such a tool. It can

f90autodoc utilizes the Fortran 90 parser library in Numpy's new f2py.

Example

The documentation syntax is, at present, simple:

module algebraic
  !! Some algebraic functions
  !!
  !! An algebraic function is informally a function which satisfies
  !! a polynomial equation whose coefficients are themselves polynomials.
  implicit none

  double precision :: golden_ratio = (sqrt(5d0) + 1d0) / 2d0 !! Golden ratio
contains
  function sqr(x) result(y)
    !! Calculates the square of x.
    !!
    !! The square is the inverse function of the square root,
    !! which itself is also an important function.
    !!
    !! It has the following properties:
    !!
    !! - Fixed points: ``sqr(1) == 1``, ``sqr(0) == 0``
    !! - Inverse function: ``sqr(sqrt(x)) == x``
    !! - Area of a square is ``sqr(length of side)``
    implicit none
    double precision, intent(in) :: x   !! Number to take the square of
    double precision :: y               !! Square of x
    y = x*x
  end function sqr

  subroutine sqr_i(x)
    !! Calculates the square of x, in place.
    implicit none
    double precision, intent(inout) :: x
    x = x*x
  end subroutine sqr_i
end module algebraic

The output for this example is here.

Files

There's no ready version yet, but the Mercurial repository is online.

2007-06-25 00:02:53 Pauli Virtanen Permanent link to this page