HP FORTRAN 77 Elements [ HP FORTRAN 77 Quick Reference Guide ]

HP FORTRAN 77 Quick Reference Guide

Chapter 1  HP FORTRAN 77 Elements 

HP FORTRAN 77 Elements 

The HP FORTRAN 77 Character Set 

Each language element is written using the letters A through Z, the
digits 0 through 9, and the following special characters:

         Blank                      (        Left parenthesis

=        Equals                     )        Right parenthesis

+        Plus                       ,        Comma

-        Minus                      .        Decimal point

*        Asterisk                   '        Single quotation mark
                                             (apostrophe)

/        Slash                      "        (Double) quotation mark

!        Exclamation point          $        Dollar sign

_        Underscore (break)         :        Colon

Special Symbols 

The special symbols are groups of characters that define specific
operators and values.  The special symbols are:

**               Exponentiation

.TRUE.           Logical true

.FALSE.          Logical false

.NOT.            Logical negation

.AND.            Logical AND

.OR.             Logical OR

.EQV.            Logical equivalence

.NEQV.           Logical non equivalence (exclusive or)

.XOR.            Same as .NEQV

.EQ.             Equal

.NE.             Not equal

.LT.             Less than

.LE.             Less than or equal

.GT.             Greater than

.GE.             Greater than or equal

Truth Table for Logical Operators 

          Table 1-1.  Truth Table for Logical Operators 

-------------------------------------------------------------------------------------------------------
|          |          |               |               |               |               |               |
|    a     |    b     |    .NOT.a     |    a.AND.b    |    a.OR.b     |   a.NEQV.b    |    a.EQV.b    |
|          |          |               |               |               |    a.XOR.b    |               |
|          |          |               |               |               |               |               |
-------------------------------------------------------------------------------------------------------
|          |          |               |               |               |               |               |
|   True   |   True   |     False     |     True      |     True      |     False     |     True      |
|          |          |               |               |               |               |               |
-------------------------------------------------------------------------------------------------------
|          |          |               |               |               |               |               |
|   True   |  False   |     False     |     False     |     True      |     True      |     False     |
|          |          |               |               |               |               |               |
-------------------------------------------------------------------------------------------------------
|          |          |               |               |               |               |               |
|  False   |   True   |     True      |     False     |     True      |     True      |     False     |
|          |          |               |               |               |               |               |
-------------------------------------------------------------------------------------------------------
|          |          |               |               |               |               |               |
|  False   |  False   |     True      |     False     |     False     |     False     |     True      |
|          |          |               |               |               |               |               |
-------------------------------------------------------------------------------------------------------

Keywords 

Keywords are predefined FORTRAN entities that identify or appear in a
statement or compiler option.  The keywords of FORTRAN are:

     ASSIGN        DO                  EXTERNAL     NONE         SUBROUTINE
     BACKSPACE     DOUBLE COMPLEX      FORMAT       OPEN         SYSTEM INTRINSIC
     BLOCK DATA    DOUBLE PRECISION    FUNCTION     PARAMETER    THEN
     CALL          ELSE                GOTO         PAUSE        TO
     CHARACTER     ELSE IF             IF           PRINT        WHILE
     CLOSE         ENCODE              IMPLICIT     PROGRAM      WRITE
     COMMON        END                 INCLUDE      READ
     COMPLEX       ENDDO               INQUIRE      REAL
     CONTINUE      ENDIF               INTEGER      RETURN
     DATA          ENDFILE             INTRINSIC    REWIND
     DECODE        ENTRY               LOGICAL      SAVE
     DIMENSION     EQUIVALENCE         NAMELIST     STOP

Data Types 

The HP FORTRAN 77 data types are shown below; storage is measured in
8-bit bytes.

          Table 1-2.  Data Types 

-----------------------------------------------------------------------------------------------
|                          |                                 |                                |
|           TYPE           |              RANGE              |            STORAGE             |
|                          |                                 |                                |
-----------------------------------------------------------------------------------------------
|                          |                                 |                                |
| integer                  | -2147483648 to +2147483647      | 4 bytes                        |
|                          |                                 |                                |
-----------------------------------------------------------------------------------------------
|                          |                                 |                                |
| short integer            | -32768 to +32767                | 2 bytes                        |
|                          |                                 |                                |
-----------------------------------------------------------------------------------------------
|                          |                                 |                                |
| real                     | system dependent*               | 4 bytes                        |
|                          |                                 |                                |
-----------------------------------------------------------------------------------------------
|                          |                                 |                                |
| double precision         | system dependent*               | 8 bytes                        |
|                          |                                 |                                |
-----------------------------------------------------------------------------------------------
|                          |                                 |                                |
| complex                  | same as real                    | 8 bytes                        |
|                          |                                 |                                |
-----------------------------------------------------------------------------------------------
|                          |                                 |                                |
| double complex           | same as double precision        | 16 bytes                       |
|                          |                                 |                                |
-----------------------------------------------------------------------------------------------
|                          |                                 |                                |
| logical                  | .TRUE. or .FALSE.               | 4 bytes                        |
|                          |                                 |                                |
-----------------------------------------------------------------------------------------------
|                          |                                 |                                |
| short logical            | .TRUE. or .FALSE.               | 2 bytes                        |
|                          |                                 |                                |
-----------------------------------------------------------------------------------------------
|                          |                                 |                                |
| character                | entire 8-bit ASCII character    | 1 byte (for each character)    |
|                          | set                             |                                |
|                          |                                 |                                |
-----------------------------------------------------------------------------------------------