Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 9/08/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Character Editing (A)

The A data edit descriptor transfers character or Hollerith values. It takes the following form:

A[w]

If the corresponding I/O list item is of type character, character data is transferred. If the list item is of any other type, Hollerith data is transferred.

The G edit descriptor can be used to edit character data; it follows the same rules as Aw.

Rules for Input Processing

On input, the A data edit descriptor transfers w characters from an external field and assigns them to the corresponding I/O list item.

The maximum number of characters that can be stored depends on the size of the I/O list item, as follows:

  • For character data, the maximum size is the length of the corresponding I/O list item.

  • For noncharacter data, the maximum size depends on the data type, as shown in the following table:

    Size Limits for Noncharacter Data Using A Editing

    I/O List Element

    Maximum Number of Characters

    BYTE

    1

    LOGICAL(1) or LOGICAL*1

    1

    LOGICAL(2) or LOGICAL*2

    2

    LOGICAL(4) or LOGICAL*4

    4

    LOGICAL(8) or LOGICAL*8

    8

    INTEGER(1) or INTEGER*1

    1

    INTEGER(2) or INTEGER*2

    2

    INTEGER(4) or INTEGER*4

    4

    INTEGER(8) or INTEGER*8

    8

    REAL(4) or REAL*4

    4

    DOUBLE PRECISION

    8

    REAL(8) or REAL*8

    8

    REAL(16) or REAL*16

    16

    COMPLEX(4) or COMPLEX*81

    8

    DOUBLE COMPLEX1

    16

    COMPLEX(8) or COMPLEX*161

    16

    COMPLEX(16) or COMPLEX*321

    32

    1 Complex values are treated as pairs of real numbers, so complex editing requires a pair of edit descriptors. (See Complex Editing.)

If w is equal to or greater than the length (len) of the input item, the rightmost characters are assigned to that item. The leftmost excess characters are ignored.

If w is less than len, or less than the number of characters that can be stored, w characters are assigned to the list item, left-justified, and followed by trailing blanks.

The following shows input using the A edit descriptor (the symbol ^ represents a nonprinting blank character):

Format     Input      Value        Data Type
A6         PAGE^#     #            CHARACTER(LEN=1)
A6         PAGE^#     E^#          CHARACTER(LEN=3)
A6         PAGE^#     PAGE^#       CHARACTER(LEN=6)
A6         PAGE^#     PAGE^#^^     CHARACTER(LEN=8)
A6         PAGE^#     #            LOGICAL(1)
A6         PAGE^#     ^#           INTEGER(2)
A6         PAGE^#     GE^#         REAL(4)
A6         PAGE^#     PAGE^#^^     REAL(8)

Rules for Output Processing

On output, the A data edit descriptor transfers the contents of the corresponding I/O list item to an external field that is w characters long.

If w is greater than the size of the list item, the data is transferred to the output field, right-justified, with leading blanks. If w is less than or equal to the size of the list item, the leftmost w characters are transferred.

The following shows output using the A edit descriptor (the symbol ^ represents a nonprinting blank character):

Format     Value         Output
A5         OHMS          ^OHMS
A5         VOLTS         VOLTS
A5         AMPERES       AMPER