Scor­pio News

  

January–March 1987 – Volume 1. Issue 1.

Page 17 of 63
100 FORMAT(9HDATA FROM,/,10HEXPERIMENT,I3)

which would print out

DATA FROM
EXPERIMENT 1   (assuming that L had a value of 1)

F80 and ProFortran recognise ten different types of I/O field descriptor:

AAlphanumeric [A – Z, 0 – 9 etc.]
DDouble precision numeric
EExponent form [e.g. 1.1E04 = 11,000]
FFloating point [e.g. 12.34)
G(can be used for floating point or exponent)
HHollerith (string)
(or)   'alternative to Hollerith
IInteger data [e.g. 12, 560)
LLogical [T(rue) c F(alse)] – not often used.
Poptional scaling descriptor used with D,​E,​F and G conversions either as a multiple or a fraction
Xblank space

These are fairly standard for most Fortrans but NFortran does not have Double Precision or the scaling descriptor P. It does have T (tabulation), K (hexadecimal) and Z (inhibit <cr,​lf> on output) which might be useful.

Most users will only be concerned with A,​E,​F,​H,​I and X descriptors; apart from the H and X descriptors, which have the general forms nH or nX where n is the number of columns each descriptor covers, the rest have the operational form rZy where r is the number of repetitions of the field descriptor if this it grater than 1, Z is the descriptor type and y giver information about the total width of field required for each repetition.

Some examples would not come amiss here –

10A4indicates 10 alphanumeric fields each 4 columns wide
E8.2indicates 1 exponent field 8 columns wide, where there are two figures after the decimal point. Thus 12345.67 is represented as 0.12E¯05 (where the ‘¯’ represents a blank column in which nothing is printed)
E12.5is a single exponent field of 12 columns in which 5 figures follow the decimal point and a figure such as −12.345678 would be represented as −0.12345E¯02. This implies that the number is truncated (shortened) and loses some accuracy.
F3.0shows that a floating point number occupying 3 columns is involved which has no significant numbers to the right of the decinal point, 7.0 er 2.0 would be shown in this way
F8.4shows that the floating point (real) number occupies 6 columns and has 4 digits to the right of the decimal point. 123.4567 is a suitable example: a real number such as −34.89088 would be shown as 34.8909, since the field only permits a maximum of 4 digits after the decimal point. Overflow can occur if the number of digits to the left of the decimal point cannot be fitted into the space available – thus 1234.56 would be printed as *.56 – the asterisk shows that the field width was too small.
4I3indicates that there are four 3 digit integer fields involved; thus 123, 245, 778 and 200 are represented as: 123245778200 while −30, 2, 45 and 559 are represented by −30¯¯2¯45559. In the latter case, the ‘−’ sign occupies 1 of the columns in its field and the numbers with less than 3 digits are right justified
4Xthis shows that 4 columns are to be skipped (not read or printed)
Page 17 of 63