Execution Control
The STOP statement terminates the program whenever and wherever it is executed.
STOP Code Extensions
The STOP statement terminates the program whenever and wherever it is executed. The STOP statement is defined as follows:
| stop-stmt | is | STOP stop_code |
| stop-code | is | scalar_char_constant |
| or | digit ... |
The character constant or list of digits identifying the STOP statement is optional and is called a stop-code. When the stop-code is a string of digits, leading zeros are not significant; 10 and 010 are the same stop-code. The Cray Fortran compiler accepts 1 to 80 digits; the standard accepts up to 5 digits.
When the stop code is a string of digits, only the least-significant 8 bits of the integer value is used as the process exit status. When the stop code is of type character or does not appear, the value zero is the process exit status.
In either case, the stop code is accessible following program termination. The Cray Fortran compiler sends it to the standard error file (stderr). The following are examples of STOP statements:
STOP
STOP 'Error #823'
STOP 20