next up previous contents
Next: Subroutines Up: Program Units Previous: Main Program Example

 

Procedures

 

A procedure, such as an intrinsic function, is an abstracted block of parameterised code that performs a particular task. Procedures should generally be used if a task has to be performed two or more times, this will cut down on code duplication.

Before writing a procedure the first question should be: ``Do we really need to write this or does a routine already exist?'' Very often a routine with the functionality already exists, for example, as an intrinsic procedure or in a library somewhere. (Fortran 90 has 113 intrinsic procedures covering a variety of functionality and the NAg fl90 Numerical Library contains over 300 mathematic procedures so there is generally a wide choicegif!)

Other libraries include: BLAS, (Basic Linear Algebra Subroutines) for doing vector, matrix-vector and matrix-matrix calculations, (these should always be used if possible); IMSL (Visual Numerics), akin to NAg Library; LaPACK, linear algebra package; Uniras, graphics routines, very comprehensive.

Note that the HPFF defined a set of routines that should be available as part of an HPF compilation system. If the target platform is to be a parallel computer it will be worth investigating further; a number of Fortran 90 version of these procedures exist, for example, at LPAC.

As the use of Fortran 90 grows many useful (portable) library modules will be developedgif which contain routines that can be USE d by any Fortran 90 program. See World Wide Web Fortran Market.

If a procedure is to be written from scratch then the following guidelines should be followed:

Return to corresponding overview page gif


next up previous contents
Next: Subroutines Up: Program Units Previous: Main Program Example

©University of Liverpool, 1997
Wed May 28 20:20:27 BST 1997
Not for commercial use.