Next: Examples of items
Up: FFREAD
Previous: Principles of Operation
Data cards are one of four types:
-
a totally blank card is just skipped
-
a comment card has as first non-blank character the single letter 'C';
the further contents of the card are ignored
-
the first non-blank item is a user-defined key or one of the system
keys (see below)
-
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:
-
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.
-
a repeat count (optional); this is indicated by any positive integer
followed by the letter '*'.
If this is missing, it defaults to 1.
-
a value (required); this takes one of four forms:
-
a standard FORTRAN signed integer
-
a standard FORTRAN signed floating point number in either fixed-point
or 'E' notation
-
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.
-
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:
-
If the key is of type 'REAL' and the item found is an integer, the integer
is converted to the corresponding floating point value before storing.
-
If the key is of type 'INTEGER' and the item found is a floating-point
number, the value stored is the result of the FORTRAN function IFIX.
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).
-
If the key is of type 'LOGICAL', any value but a logical constant results
in an error.
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: Examples of items
Up: FFREAD
Previous: Principles of Operation
Janne Saarela
Tue May 16 09:50:47 METDST 1995