HP 3000 Manuals

Statement Classification [ HP FORTRAN 77/iX Reference ] MPE/iX 5.0 Documentation


HP FORTRAN 77/iX Reference

Statement Classification 

A FORTRAN statement can be either executable or nonexecutable.
Executable statements specify the actions that the program is to take.
Nonexecutable statements contain information such as the characteristics
of operands, type of data, and format specifications for input/output.
Each FORTRAN statement is categorized in Table 3-1 .

          Table 3-1.  Executable and Nonexecutable Statements 

---------------------------------------------------------------------------
|                                    |                                    |
|       Executable Statements        |      Nonexecutable Statements      |
|                                    |                                    |
---------------------------------------------------------------------------
|                                    |                                    |
| ACCEPT                             | BLOCK DATA                         |
| ASSIGN                             | BYTE                               |
| Assignment                         | CHARACTER                          |
| BACKSPACE                          | COMMON                             |
| CALL                               | COMPLEX (*8, *16)                  |
| CLOSE                              | DATA                               |
| CONTINUE                           | DIMENSION                          |
| DECODE                             | DOUBLE COMPLEX                     |
| DELETE                             | DOUBLE PRECISION                   |
| Block DO                           | END MAP                            |
| Labeled DO                         | END STRUCTURE                      |
| DO-WHILE                           | END UNION                          |
| ELSE IF                            | ENTRY                              |
| ELSE                               | EQUIVALENCE                        |
| ENCODE                             | EXTERNAL                           |
| END                                | FORMAT                             |
| END DO                             | FUNCTION                           |
| ENDFILE                            | IMPLICIT                           |
| ENDIF                              | INCLUDE                            |
| GOTO                               | INTEGER (*2, *4)                   |
| Arithmetic IF                      | INTRINSIC                          |
| Block IF                           | LOGICAL (*1, *2, *4)               |
| Logical IF                         | MAP                                |
| INQUIRE                            | NAMELIST                           |
| OPEN                               | PARAMETER                          |
| PAUSE                              | PROGRAM                            |
| PRINT                              | REAL (*4, *8, *16)                 |
| READ                               | RECORD                             |
| RETURN                             | SAVE                               |
| REWIND                             | Statement Function                 |
| REWRITE                            | STRUCTURE                          |
| STOP                               | SUBROUTINE                         |
| TYPE                               | SYSTEM INTRINSIC                   |
| UNLOCK                             | UNION                              |
| WRITE                              | VIRTUAL                            |
|                                    | VOLATILE                           |
|                                    |                                    |
---------------------------------------------------------------------------

Executable and nonexecutable statements can be further grouped into seven
functional categories, displayed in Table 3-2 .  The categories are:

   *   Program unit statements.
   *   Specification statements.
   *   Value assignment statements.
   *   Initialization statements.
   *   Control statements.
   *   Input/output statements.
   *   Program halt or suspension statements.

          Table 3-2.  Classification of Statements 

--------------------------------------------------------------------------------------------
|                            |                                                             |
| Program Unit Statements    |                         Description                         |
|                            |                                                             |
--------------------------------------------------------------------------------------------
|                            |                                                             |
| BLOCK DATA                 | Identifies a program unit as a block data subprogram.       |
|                            |                                                             |
| END                        | Identifies the end of a program unit.                       |
|                            |                                                             |
| ENTRY                      | Provides an alternative entry into a function or            |
|                            | subroutine.                                                 |
|                            |                                                             |
| FUNCTION                   | Identifies a program unit as a function subprogram.         |
|                            |                                                             |
| PROGRAM                    | Identifies a program unit as a main program.                |
|                            |                                                             |
| Statement Function         | Defines a one-statement function.                           |
|                            |                                                             |
| SUBROUTINE                 | Identifies a program unit as a subroutine subprogram.       |
|                            |                                                             |
--------------------------------------------------------------------------------------------
|                            |                                                             |
| Specification Statements   |                         Description                         |
|                            |                                                             |
--------------------------------------------------------------------------------------------
|                            |                                                             |
| COMMON                     | Reserves a block of memory that can be used by more than    |
|                            | one program unit.                                           |
|                            |                                                             |
| DIMENSION                  | Defines the dimensions and bounds of an array.              |
|                            |                                                             |
| END MAP                    | Defines the end of a MAP statement group.                   |
|                            |                                                             |
| END STRUCTURE              | Defines the end of a STRUCTURE statement group.             |
|                            |                                                             |
| END UNION                  | Defines the end of a UNION statement group.                 |
|                            |                                                             |
| EQUIVALENCE                | Associates variables so that they share the same place in   |
|                            | memory.                                                     |
|                            |                                                             |
| EXTERNAL                   | Identifies subprogram names used as actual arguments or as  |
|                            | nonintrinsics.                                              |
|                            |                                                             |
| IMPLICIT                   | Specifies the type associated with the first letter of a    |
|                            | symbolic name.                                              |
|                            |                                                             |
| INTRINSIC                  | Identifies intrinsic function names used as actual          |
|                            | arguments.                                                  |
|                            |                                                             |

| MAP                        | Identifies a group of statements that define the form of    |
|                            | fields within a union.                                      |
|                            |                                                             |
| NAMELIST                   | Defines a list of variables or array names and associates   |
|                            | that list with a group-name.                                |
|                            |                                                             |
--------------------------------------------------------------------------------------------
|                                                                                          |
|                               (Continued on the next page)                               |
|                                                                                          |
--------------------------------------------------------------------------------------------

          Table 3-2.  Classification of Statements (cont.) 

--------------------------------------------------------------------------------------------

| Specification Statements   |                         Description                         |
|                            |                                                             |
--------------------------------------------------------------------------------------------
|                            |                                                             |
| PARAMETER                  | Defines named constants.                                    |
|                            |                                                             |
| RECORD                     | Defines records declared in a previous structure            |
|                            | declaration.                                                |
|                            |                                                             |
| SAVE                       | Retains the value of an entity after execution of a RETURN  |
|                            | or END statement in a subprogram.                           |
|                            |                                                             |
| STRUCTURE                  | Begins a group of statements that defines the form of a     |
|                            | record.                                                     |
|                            |                                                             |
| Type Specification         | Assigns an explicit type to a variable.                     |
|                            |                                                             |
| UNION                      | Associates fields within a structure so that they occupy    |
|                            | the same physical location in memory.                       |
|                            |                                                             |
| VIRTUAL                    | Defines the dimensions and bounds of an array; like         |
|                            | DIMENSION.                                                  |
|                            |                                                             |
| VOLATILE                   | Identifies variables, arrays, or common blocks that will    |
|                            | not be selected for global analysis or optimization by the  |
|                            | compiler.                                                   |
|                            |                                                             |
--------------------------------------------------------------------------------------------
|                            |                                                             |
| Value Assignment           |                         Description                         |
| Statements                 |                                                             |
|                            |                                                             |
--------------------------------------------------------------------------------------------
|                            |                                                             |
| ASSIGN                     | Assigns a statement label to an integer variable.           |
|                            |                                                             |
| Assignment                 | Assigns values to variables at execution time.              |
|                            |                                                             |
--------------------------------------------------------------------------------------------
|                            |                                                             |
| Initialization Statements  |                         Description                         |
|                            |                                                             |
--------------------------------------------------------------------------------------------
|                            |                                                             |
| DATA                       | Assigns initial values to variables before execution.       |
|                            |                                                             |
| Type Specification         | Can optionally initialize variables before execution.       |
|                            |                                                             |
--------------------------------------------------------------------------------------------
|                            |                                                             |
| Control Statements         |                         Description                         |
|                            |                                                             |
--------------------------------------------------------------------------------------------
|                            |                                                             |
| CALL                       | Transfers control to an external procedure.                 |
|                            |                                                             |
| CONTINUE                   | Causes execution to continue; has no effect of its own.     |
|                            |                                                             |
| Block DO, Labeled DO       | Executes a group of statements a specific number of times.  |
|                            |                                                             |
| DO-WHILE                   | Executes a group of statements while a condition is true.   |
|                            |                                                             |
| END DO                     | Terminates a DO or DO-WHILE block.                          |
|                            |                                                             |
| ENDIF                      | Terminates an IF-THEN block.                                |
|                            |                                                             |
| ELSE                       | Marks the beginning of a block of statements to be executed |
|                            | if the logical expression in its corresponding IF-THEN      |
|                            | statement evaluates to false.                               |
|                            |                                                             |
| ELSE IF                    | Same as an ELSE statement that has an IF-THEN statement as  |
|                            | the first statement of its ELSE block.                      |
|                            |                                                             |
| GOTO                       | Transfers control to a specified statement.                 |
|                            |                                                             |
--------------------------------------------------------------------------------------------
|                                                                                          |
|                               (Continued on the next page)                               |
|                                                                                          |
--------------------------------------------------------------------------------------------

          Table 3-2.  Classification of Statements (cont.) 

--------------------------------------------------------------------------------------------

| Control Statements         |                         Description                         |
|                            |                                                             |
--------------------------------------------------------------------------------------------
|                            |                                                             |
| Arithmetic IF              | Transfers control based on a condition.                     |
|                            |                                                             |
| Block IF                   | Executes optional groups of statements based on one or more |
|                            | conditions.                                                 |
|                            |                                                             |
| Logical IF                 | Conditionally executes a statement based on a logical       |
|                            | value.                                                      |
|                            |                                                             |
| RETURN                     | Transfers control from a subprogram back to the calling     |
|                            | program.                                                    |
|                            |                                                             |
--------------------------------------------------------------------------------------------
|                            |                                                             |
| Input/Output Statements    |                         Description                         |
|                            |                                                             |
--------------------------------------------------------------------------------------------
|                            |                                                             |
| ACCEPT                     | Transfers input data from the standard input unit to an     |
|                            | internal storage area.                                      |
|                            |                                                             |
| BACKSPACE                  | Positions a file at the previous record.                    |
|                            |                                                             |
| CLOSE                      | Terminates access to a file.                                |
|                            |                                                             |

| DECODE                     | Transfers data from internal storage to variables.          |
|                            |                                                             |
| DELETE                     | Deletes an indexed sequential access (ISAM) record.         |
|                            |                                                             |
| ENCODE                     | Transfers data from variables to internal storage.          |
|                            |                                                             |
| ENDFILE                    | Writes an end-of-file.                                      |
|                            |                                                             |
| FORMAT                     | Describes how input/output information is arranged.         |
|                            |                                                             |
| INQUIRE                    | Supplies information about files.                           |
|                            |                                                             |
| OPEN                       | Allows access to a file.                                    |
|                            |                                                             |
| PRINT                      | Transfers data out.                                         |
|                            |                                                             |
| READ                       | Transfers data in.                                          |
|                            |                                                             |
| REWIND                     | Positions a file at beginning-of-file.                      |
|                            |                                                             |
| REWRITE                    | Updates an indexed sequential access (ISAM) record.         |
|                            |                                                             |
| TYPE                       | Transfers data out.                                         |
|                            |                                                             |
| UNLOCK                     | Unlocks an indexed sequential access (ISAM) record.         |
|                            |                                                             |
| WRITE                      | Transfers data out.                                         |
|                            |                                                             |
--------------------------------------------------------------------------------------------
|                            |                                                             |
| Program Halt Statements    |                         Description                         |
|                            |                                                             |
--------------------------------------------------------------------------------------------
|                            |                                                             |
| PAUSE                      | Causes a program suspension.                                |
|                            |                                                             |
| STOP                       | Terminates program execution.                               |
|                            |                                                             |
--------------------------------------------------------------------------------------------



MPE/iX 5.0 Documentation