Next: Exceptions to the
Up: The FORTRAN-77 programming
Previous: Error messages
Machine-dependence has an impact on several areas, in particular in:
- precision that is used in the computations
- open statements
- machine-dependent constants
- plot commands
We shall consider each of these items separately;
- precision that is used in the computations
Most present day computers use 32-bits arithmetic (except CRAY and
ALPHA processor-based computers). This means that for large-scale numerical
applications it is necessary to use double precision arithmetic. In
order to translate the double precision version easily into a single
precision version by some tool, it is necessary to apply the following
rules:
- declare explicit with double precision or complex 16.
Use small letters for these declarations.
- use always generic names for intrinsics.
- use always small letters when BLAS subroutines are called en do
not use spaces in these names. Unfortunately no generic names for BLAS
subroutines can be used. For each precision a separate subroutine must
be used.
- open statements
Open statements may be machine-dependent. Especially the name of a file
is in general machine-dependent, but in general also some other options
may have machine-dependent aspects. For that reason it is advised to put
all open statements in a general machine-dependent subroutine.
In SEPRAN subroutine INIFIL is used for all open statements, in ISNaS it
is the subroutine ISINIFIL.
The names of the files are stored in a common, containing
machine-dependent names.
- machine-dependent constants
Some machine-dependent constants, like machine accuracy, largest real
number and so on, are used in many programs. It is a good practice to
initialize these constants in general machine-dependent subroutine and
to put them in a common block.
- plot commands
Plot commands are not only machine-dependent, they may also be device or
even package-dependent. It is for that reason sensible to avoid actual
calls to low level plotting subroutines in the programs. This is
possible if some intermediate plotting subroutine is defined, that
simulates the actual plot calls. This own subroutine may contain
machine-dependent calls or even make a "local" neutral plot file. It is
good practice to restrict the number of local machine-dependent plot
subroutines to a small number (for example 3 or 4).
In SEPRAN a number of machine-dependent constants and file names may be
defined by an environment file (sepran.env), in ISNaS this environment
file is called isnas.env.
Next: Exceptions to the
Up: The FORTRAN-77 programming
Previous: Error messages
ISNaS ontwikkeling
Wed May 24 08:37:14 METDST 1995