Machine dependency
Machine dependency can be found in various cases, in particular:
- Precision used for calculating.
- Open statements.
- Machine-dependent constants.
- Plot instructions.
These cases are discussed below.
- There are computers which calculate in 64 bits, for example several super computers such as CRAY.
This means that large-scale numerical applications need to be calculated in double-precision. The
following rules need to be observed for easy distillation of a single-precision version from such
a double-precision version:
- Declare explicitly with DOUBLE PRECISION or COMPLEX * 16, repeat the declaration with REAL
and COMPLEX, but include the letter combination ce into the relevant lines in columns 1 and 2. Always
write DOUBLE PRECISION with one space and always write COMPLEX * 16 with one space on either side
of the . Always write these statements in lower case.
- Always use generic names for intrinsic functions.
These rules allow the simple conversion of a double-precision into a single-precision version and vice versa.
- Unfortunately, open statements are machine-dependent. The filename presents the biggest problem.
According to the official standard the filename can be incorporated into the open statement, but an
IBM mainframe rejects this. It is therefore necessary to include as many open statements as possible
in one machine-dependent subroutine. Additionally, different computers can then accept different
filenames.
- Certain machine-dependent constants, such as machine accuracy and largest real number,
are used in many programs. It is recommended to initialize these constants in a general
machine-dependent subroutine and to include them in a module.
- Plot instructions are not only machine-dependent, but also device-dependent and package-dependent.
Using real plot calls in programming should be avoided. This can be done by creating a separate
plot routine which simulates plot calls at any level. This plot routine can contain the
machine-dependent calls or, if necessary, can generate a local neutral file. It is recommended
to use as few separate machine-dependent plot routines as possible.
The SWAN team 2022-08-10