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 choice!)
As the use of Fortran 90 grows many useful (portable) library modules will be
developed
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: