next up previous contents index
Next: Examples of items Up: FFREAD Previous: Principles of Operation

Syntax of the data cards

Data cards are one of four types:

  1. a totally blank card is just skipped
  2. a comment card has as first non-blank character the single letter 'C'; the further contents of the card are ignored
  3. the first non-blank item is a user-defined key or one of the system keys (see below)
  4. the remaining cards are considered to be continuation cards, i.e. their information applies to the last key identified. If the last key is not defined (because this is the first non-blank, non-comment card read or because the last key was a system key), an error message is issued.

In all cases but for the exceptions connected with hollerith items, upper and lower case characters are considered identical. Once a key has been identified, the data card is scanned for items of infor- mation or, in the case of a system key, some special action is taken.

An item of information consists of three parts, two of which are optional, and it must be wholly contained on one card:

  1. an indication of where the information is to be stored in an array (optional); this is indicated by any positive integer followed by the letter '='. If this part is missing, it defaults to 1 if this is the first item for a key or to the updated value from the previous item, i.e. position of previous item + repeat count of previous item.
  2. a repeat count (optional); this is indicated by any positive integer followed by the letter '*'. If this is missing, it defaults to 1.
  3. a value (required); this takes one of four forms:
    1. a standard FORTRAN signed integer
    2. a standard FORTRAN signed floating point number in either fixed-point or 'E' notation
    3. a hollerith text, which is delimited by a special character (default is the apostrophe '). Such a value may be continued on the following card(s) and is copied literally, i.e. without case conversion.
    4. a logical constant, where the following values are defined:
      • 'T', 'ON' , or 'TRUE' for the FORTRAN logical value .TRUE.
      • 'F', 'OFF', 'FALS', or 'FALSE' for the FORTRAN logical value .FALSE.
If a key is identified and the rest of the card is blank, this defaults to '1', '1.', or '.TRUE.', depending on the type of key. If no recognized type was given for the key, an integer 1 is stored.

If more than one part is present, they must be in the above order and adjacent, i.e. with no blanks between them.

The value is then stored, starting at the indicated position in the array and for the indicated number of times given by the repeat count.

If anything on a data card doesn't fit the above description, it is considered to be an in-line comment and is skipped.

For all numerical values, the space used per value is one FORTRAN word. For a hollerith value, the space consumed depends on the number of characters in the string and the number of characters which can be stored in one word on the particular computer. However, one word is the minimum and any remaining space in the last (or only) word is blank-filled. As the space required by hollerith values cannot be predicted before the end of the string is reached (which might be on a continuation card), a repeat count is not allowed for such values.

The value actually stored depends on the data type for the key given by the user when he defined it:

In either case, if a logical constant is given, the corresponding logical value is stored (i.e. in this case no type checking is performed).

In all cases, bounds checking is performed, i.e. the user cannot store values into locations that are not part of an array (as declared at the time of key definition).

If any error occurs during scanning of an item, no action is performed for this card (even if correct items were found before) and the scan is terminated. Continuation cards are however interpreted for this key; the current position may not be what the user expected.



next up previous contents index
Next: Examples of items Up: FFREAD Previous: Principles of Operation

Janne Saarela
Tue May 16 09:50:47 METDST 1995