HP 3000 Manuals

Logical Constants [ HP FORTRAN 77/iX Migration Guide ] MPE/iX 5.0 Documentation


HP FORTRAN 77/iX Migration Guide

Logical Constants 

Logical constants of the form %"chars"L are not allowed in HP FORTRAN
77/V. The migration aid converts logical constants of this form to
Hollerith constants.  For example, the following octal constant:

     %"ABD"L

is converted to

     3HABC

The migration aid converts only logical constants of the form %"chars"L
in which chars is a character string of up to four characters.  If you
need to convert longer logical constants, you should modify this section
of the migration aid.

Condition Code, Parameters Passed by Value, and Alternate Returns 

When this command is applied, the following changes occur:

   *   Condition code constructs of the form .CC. are changed to CCODE().

   *   The backslashes (\) that precede parameters passed by value are
       deleted.


NOTE In HP FORTRAN 77/V, passing parameters by value requires that an ALIAS directive be inserted in the source code. This insertion must be done manually.
* The dollar signs ($) in alternate returns are changed to asterisks (*). For example, CALL SUBRTN(A,$1,$2) is changed to SUBRUTN(A,*1,*2). ACCEPT and DISPLAY Statements The migration aid converts the ACCEPT statement to READ and the DISPLAY statement to PRINT. The syntax of these statements is changed as well as their names. For information on READ and PRINT, see the HP FORTRAN 77/iX Reference manual. INTEGER and LOGICAL Type Declarators INTEGER*2 is the default size of integers in FORTRAN 66/V, while INTEGER*4 is the default in HP FORTRAN 77/V. The migration aid converts INTEGER to INTEGER*2 and LOGICAL to LOGICAL*2 if no other length is specified. Declarators already having length specifiers are not converted. PARAMETER and CHARACTER Type Declarators When this command is applied, the migration aid converts the syntax of PARAMETER statements by enclosing the parameter constants in parentheses.
NOTE HP FORTRAN 77/V requires that parameter constants be explicitly typed (as INTEGER, CHARACTER, etc.). This typing must be done manually.
The migration aid also converts the syntax of CHARACTER type declarators. For example, CHARACTER BUF*10(20) is changed to CHARACTER BUF(20)*10. Parameterless System Intrinsics The system intrinsics listed below are changed to parameterless system intrinsics. CALENDAR FATHER GETPRIVMODE TERMINATE CAUSEBREAK FREELOCRIN GETUSERMODE TIMER CLOCK GETJCW PROCTIME DEBUG GETORIGIN RESETDUMP For example, date=CALENDAR is changed to date=CALENDAR() If your program contains variables with names identical to these system intrinsics, answer A so that you are prompted before each change is made. New Function Names The following are the FORTRAN 66/V intrinsic functions whose names or parameter types are changed by the migration aid. For example, in FORTRAN 66/V the function IABS has an INTEGER*2 parameter, whereas in HP FORTRAN 77/V its parameter type is INTEGER*4. Therefore, IABS is changed to HABS, which has an INTEGER*2 parameter. Table 3-3. Conversions of Function Names or Types. -------------------------------------------------- | | | | FORTRAN 66/V | HP FORTRAN 77/V | | | | -------------------------------------------------- | | | | IABS | HABS | | | | -------------------------------------------------- | | | | JABS | IABS | | | | -------------------------------------------------- | | | | JINT | INT | | | | -------------------------------------------------- | | | | JDINT | IDINT | | | | -------------------------------------------------- | | | | FLOATJ | FLOAT | | | | -------------------------------------------------- | | | | INUM | ICHAR | | | | -------------------------------------------------- | | | | JNUM | ICHAR | | | | -------------------------------------------------- | | | | JMOD | MOD | | | | -------------------------------------------------- | | | | MOD | HMOD | | | | -------------------------------------------------- | | | | AJMAX0 | AMAX0 | | | | -------------------------------------------------- | | | | JMAX0 | MAX0 | | | | -------------------------------------------------- | | | | JMAX1 | MAX1 | | | | -------------------------------------------------- | | | | AJMIN0 | AMIN0 | | | | -------------------------------------------------- | | | | JMIN0 | MIN0 | | | | -------------------------------------------------- | | | | JMIN1 | MIN1 | | | | -------------------------------------------------- | | | | JFIX | IFIX | | | | -------------------------------------------------- | | | | ISIGN | HSIGN | | | | -------------------------------------------------- | | | | JSIGN | ISIGN | | | | -------------------------------------------------- | | | | IDIM | HDIM | | | | -------------------------------------------------- | | | | JDIM | IDIM | | | | -------------------------------------------------- Conversion of Constructs of the Form VAR[i:j] In FORTRAN 66/V, substring designators and partial word designators have the same form: VAR[i:j]. Only a compiler can determine whether a construct is a substring designator or a partial word designator. Therefore, the migration aid splits the conversion of this construct into two parts. The first part asks whether to treat such constructs as substring designators; the second asks whether to treat them as partial word designators.
NOTE Be sure to coordinate your responses to the substring designator and partial word designator commands. If you respond Y to one, you should not respond Y to the other. If you are not sure whether a response would be appropriate for all occurrences, answer A (ask) so that you are prompted as each occurrence is found.
Substring Designators This command converts constructs of the form VAR[i:j] to substrings. Note that whereas in FORTRAN 66/V j represents the number of characters in the substring, in HP FORTRAN 77/V j represents the position of the last character. Applying this command can sometimes result in awkward algebraic expressions. The section "Eliminating Awkward Algebraic Expressions" discusses a partial solution to this problem. Partial Word Designators This command converts VAR[i:j] to a call to MVBITS or IBITS depending on the left side of the assignment statement.
NOTE The partial word designators in FORTRAN 66/V start counting the bits from the left, whereas the bit manipulation routines in HP FORTRAN 77/V start counting the bits from the right. For example, I=IVAR[1:2] indicates the second and third bits from the left in FORTRAN 66/V, but in the functions MVBITS and IBITS it indicates the second and third bits from the right. This difference may result in awkward algebraic expressions that, although correct, may be difficult to read. The next section discusses a partial solution to this problem.
Eliminating Awkward Algebraic Expressions Applying the partial word designator or substring designator command can result in awkward algebraic expressions such as ...,16-0,... or ...,-1+1,... These expressions are inefficient and visually awkward. This command improves the form of these expressions. Replacing the STR Function If you select the STR conversion command, the migration aid converts expressions of the form variable1=STR(variable2,format) to internal WRITE statements of the form WRITE(variable1,format) variable2 Deleting the 'END=' Specifier in WRITE Statements 'END=' specifiers are not allowed in HP FORTRAN 77 WRITE statements. The migration aid removes 'END=' specifiers from WRITE statements if you select this command.


MPE/iX 5.0 Documentation