24.11.2014 Views

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Format<br />

11.10.1 Namelist-Directed Input (Extension)<br />

The input data must be in a special format. The first character in each record must be blank. The second<br />

character in the first record of a group of data records must be an ampersand (&) or dollar sign ($)<br />

immediately followed by the NAMELIST name. The NAMELIST name must be followed by a blank and<br />

must not contain any imbedded blanks. This name is followed by data items, optionally separated by<br />

commas. The end of a data group is signaled by the character "&" or "$", optionally followed by the string<br />

"END". If the "&" character was used to start the group, then it must be used to end the group. If the "$"<br />

character was used to start the group, then it must be used to end the group.<br />

12345678901234567890...<br />

&NL<br />

item1, item2, item3,<br />

item4, item5, ...<br />

The form of the data items in an input record is:<br />

Name = Constant<br />

The name may be a variable name, an array element name, or a character substring name.<br />

The constant may be integer, real, complex, logical or character. Logical constants may be<br />

in the form "T" or ".TRUE" and "F" or ".FALSE". Character constants must be contained<br />

within apostrophes. Subscripts and substring indices must be of integer type.<br />

ArrayName = Set of Constants<br />

The set of constants consists of constants of the type integer, real, complex, logical or<br />

character. The constants are separated by commas. The number of constants must be less<br />

than or equal to the number of elements in the array. Successive occurrences of the same<br />

constant may be represented in the form r*constant, where r is a non-zero integer<br />

constant specifying the number of times the constant is to occur. Consecutive commas<br />

within a list indicate that the values of the array elements remain unchanged.<br />

The variable and array names specified in the input file must appear in the NAMELIST list, but the order is<br />

not important. A name that has been made equivalent to a name in the input data cannot be substituted for<br />

that name in the NAMELIST list. The list can contain names of items in COMMON but must not contain<br />

dummy argument names.<br />

Each data record must begin with a blank followed by a complete variable or array name or constant.<br />

Embedded blanks are not permitted in names or constants. Trailing blanks after integers and exponents are<br />

treated as zeros.<br />

Example:<br />

&PERSON<br />

NAME = ’John Doe’<br />

STREET = ’22 Main St.’ CITY = ’Smallville’<br />

STATE = ’Texas’ COUNTRY = ’U.S.A.’<br />

ZIP_CODE = ’78910-1203’<br />

MARKS = 73, 82, 3*78, 89, 2*93, 91, 88<br />

AGE = 23<br />

&END<br />

The input forms acceptable to format specifications for a given type are also acceptable for<br />

namelist-directed formatting with certain exceptions.<br />

Namelist-Directed Formatting (Extension) 241

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!