# TAF: Transformation of Algorithms in Fortran

**OVERVIEW:**

TAF is a source-to-source translator for Fortran code,
i.e. TAF accepts Fortran code as input,
and generates Fortran code.
TAF supports several semantic transformations.
The most important one is Automatic Differentiation (AD),
i.e. generation of code for evaluation
of the first-order derivative (Jacobian matrix).
This generated code can operate in forward or reverse mode
(tangent linear or adjoint model).
TAF can generate code to evaluate
Jacobian times vector products or the full Jacobian.
Higher order derivative code is generated by applying TAF multiple times.

Another TAF transformation is Automatic Sparsity Detection (ASD),
i.e. efficient determination of the sparsity structure of the Jacobian matrix.
This transformation is important,
because the Jacobian's sparsity pattern
can be exploited to render the evaluation of the Jacobian more efficient.

TAF also generates code to evaluate the underlying function several times simultaneously.
This clone mode increases spatial locality of data accesses
and thus can speed up the computations on modern architectures using a hirarchie of memory.

**HIGHLIGHTS:**

- Language Support:
- Fortran-77
- Fortran-90
- Fortran-95
- Fortran-2003
- Fortran-2008
- Fortran-2018
- Fortran-2023 (partial)

- Parallelisation:
- TAF supports parts of OpenMP and MPI.
- TAF has basic upport of coarrays.
- Analyses:
- TAF normalises the code and applies a control flow analysis.
- TAF applies an intraprocedural data dependence
and an interprocedural data flow analysis.
Given the independent and dependent variables
of the specified top-level routine,
TAF determines all active routines and variables and produces
derivative code only for those.
- Transformations:
- Automatic Differentiation
- Automatic Sparsity Detection
- Code Cloning
- Directives:
- TAF accepts several kinds of directives.
Using the reverse mode automatic storing/reading
of required values is triggered by directives.
Multi level checkpointing can be generated
by splitting a loop and inserting directives.
Generating memory efficient adjoint code for iterative
solvers can be triggered by inserting a directive.
Black box (library) routines are handled
by specifying flow information via directives.
- Options:
- TAF accepts several options to control processing.
- Readability:
- TAF generated code is structured an well readable.

**APPLICATIONS:**

There is an

overview
and a list of

references
for some of TAF's applications.

**AVAILABILITY:**

TAF is a commercial product.

Contact
us to obtain a TAF licence.