Next: Error messages
Up: The FORTRAN-77 programming
Previous: Control statements
- Use the i/o statement keywords WRITE and READ only, hence do not
use PRINT. Never use as device specification since is in
general machine-dependent.
- Use variables as logical unit numbers, both in READ and WRITE
statements.
- Always use IOSTAT to test the i/o status and never use ERR=, END
=.
- Use only a blank as carriage control. In general carriage control
does not make sense any more at present day computers.
- Be sure that error message are user friendly, and give the name of
the module in which the error appears.
- Close files which are not longer in use.
- Open statements are always machine-dependent. We refer to
Section 2.5 for remarks on machine-dependence.
- Do not use free format output, i.e. , but always use format
statements. There are several reasons to use formats, the first one is that
HP compilers contain errors in case of free format. The second and most
important one is that the output of various computers can only be compared by
a diff command if the formats are fixed. The use of a format in
the write command itself is not recommended, since it does not improve
the readableness.
- User input must be case-insensitive. The read modulus must not distinguish
between small letters and capitals. The only exception is string input,
which must be case sensitive. These strings may for example be indicated by
putting them between quotes.
- Numerical input must always be free format.
The programmer is completely free to use the formats he likes.
However, with respect to the e or d format it is suggested to use the following
combination:
ss, 5(1pe12.3e2)
where ss means suppress sign, 1p means put always one digit before the decimal
point and e2 means that always two digits of the exponent are given.
Of course the numbers 5, 12 and 3 may be replaced by other suitable choices.
Remark: In a parallel environment, printing is a difficult task if
you are not at the host. For that reason it is suggested that all print output
should be done by only one subroutine. In ISNaS the subroutine ISPRINT is
available, which automatically sends the output to the host, where it is
printed.
Next: Error messages
Up: The FORTRAN-77 programming
Previous: Control statements
ISNaS ontwikkeling
Wed May 24 08:37:14 METDST 1995