INTEGER Output: The I Descriptor

The Iw and Iw.m descriptors are for INTEGER output. The general form of these descriptors are as follows:

rIw    and     rIw.m

The meaning of r, w and m are:


Let us look at the following example. There are three INTEGER variables a, b and c with values 123, -123 and 123456, respectively. In the following table, the WRITE statements are shown in the left and their corresponding output, all using five positions, are shown in the right.

Consider the following example. The WRITE statement has three INTEGER variables and consequently the format must also have three I edit descriptors, one for each variable.

INTEGER :: a = 3, b = -5, c = 128

WRITE(*,"(3I4.2)")  a, b, c
The edit descriptor is 3I4.2 and the format is equivalent to (I4.2,I4.2,I4.2) because the repetition indicator is 3. Therefore, each of the three INTEGER variables is printed with I4.2. Based on the discussion earlier, the result is the following: