41. TAO Applications using PETSc and FORTRAN

Most of the functionality of TAO can be obtained by people who program purely in Fortran 77 or Fortran 90. Note, however, that we recommend the use of C and/or C++ because these languages contain several extremely powerful concepts that the Fortran77/90 family does not. The TAO Fortran interface works with both F77 and F90 compilers.

Since Fortran77 does not provide type checking of routine input/output parameters, we find that many errors encountered within TAO Fortran programs result from accidentally using incorrect calling sequences. Such mistakes are immediately detected during compilation when using C/C++. Thus, using a mixture of C/C++ and Fortran often works well for programmers who wish to employ Fortran for the core numerical routines within their applications. In particular, one can effectively write TAO driver routines in C++, thereby preserving flexibility within the program, and still use Fortran when desired for underlying numerical computations.

Only a few differences exist between the C and Fortran TAO interfaces, all of which are due to differences in Fortran syntax. All Fortran routines have the same names as the corresponding C versions, and command line options are fully supported. The routine arguments follow the usual Fortran conventions; the user need not worry about passing pointers or values. The calling sequences for the Fortran version are in most cases identical to the C version, except for the error checking variable discussed in Section . In addition, the Fortran routine TaoInitialize(char *filename,int info) differs slightly from its C counterpart; see the manual page for details.