Compaq KAP Fortran/OpenMP
for Tru64 UNIX
User Guide


Previous Contents Index

10.2.3 INCLUDE File Markings

If the INCLUDE Fortran 90 statement is used within a program, the code that was included appears in the listing file with a plus sign (+) immediately after the line number on each line of the file. INCLUDEd lines are numbered separately from the lines of the main file. An example of this (from an -lo=o listing) follows:


2 subroutine fr (w) 
3 real w 
4 INCLUDE  'b.f' 
1 + a = 1.0 
2 + w = w - a 
5 return 
6 end 

10.2.4 Footnotes

Important details about the actions taken by KAP are given in the Footnotes listing. The Footnotes are numbered and printed at the bottom of each program unit under the Footnote List heading. References to the footnotes are displayed in the listing under the column headed Footnotes. An example of a footnote follows.

In the listing the following appears:


13  DD  1790  if (b(i).le.6) ib(j*i) = i+j 

At the end of the listing under the heading, Footnotes, is the following:


13: data dependence  Data dependence involving this line due to variable IB 

In this example, 13 is the footnote number, DD, meaning data dependence, is the class of message issued by KAP, and the if statement on line 1790 is the reference for this footnote.

10.2.5 Syntax Error/Warning Messages

When KAP detects syntax errors, it simply copies the input program unit to the transformed code file with no attempt to optimize the code.

When a program has syntax errors, messages are presented in the source (-listoptions=o) listing, interspersed with the user's code. Regardless of whether an original listing is requested, stderr: notes syntax errors and warnings. To locate the error messages in the source listing, look for lines beginning with the symbols ###, for example:


Footnotes Actions  DO Loops Line 
                            1   SUBROUTINE Z(A, B, N) 
                            2   REAL  A(N,N), B(N,N) 
                   +--------3   DO 20 I=1,N 
                   !+-------4   DO 20 J=1,N 
                   !!       5   X = A(I,J) 
                   !!       6   Y = B(I,J) 
                   !!_______7   20  C(I,J) = X + Y 
 
### line(7) 
### error %KAP-E-DO_NON_EXE, DO loop ends on a non-executable statement. 
### error %KAP-E-STMT_FUNCTION_O, Array not declared or statement 
          function declared after executable statements. 
                            8   PRINT *, X 
                            9   RETURN 
                           10   END 

KAP also may intersperse syntax warning messages with the user's code, but optimization proceeds. Syntax warnings are for constructs that are not legal, but whose intent is clear.

10.2.6 Questions Generated by KAP

At times KAP needs additional information on which to base optimization decisions. In these cases KAP may ask a question to indicate what additional information is needed.

The following loop comes from an example for -listoptions=o:


1 2  q  so  +--------- 24      DO 135 I = 1,N 
3    DD SO  !_________ 25  135 D(IP(I)) = C(I) + 3 
3: question %KAP-I-PERMUTATION_VEC, Is "IP" a permutation vector? 

If you know IP is a permutation vector (or, at least, contains no duplicate values), this information can be passed to KAP with the following assertion:


!*$* assert permutation (ip) 
    DO 135 I = 1,N 
135   D(IP(I)) = C(I) + 3 

This information may enable KAP to optimize the loop or the surrounding code. See Chapter 7 for information about KAP assertions.

10.2.7 Action Summary

Statements that are translated or modified by KAP are identified by abbreviations in the Action Summary listing field. The notations tell which class(es) of messages were issued for each line or statement. The following list explains each of these classes. KAP lists the abbreviated explanation of its actions at the bottom of the listing. For the DIR class, the class itself usually serves as the message; no detailed message follows. All other class abbreviations indicate a message follows in this class.

The abbreviations and meanings of these classes are as follows:

10.3 Loop Table Messages

The Loop Table listing (-listoptions=l) includes an entry for each loop indicating whether it was optimized, or why it was not. This section lists the possible messages and gives a brief explanation for each. The two most common reasons for a loop to be left serial are that the iterations were not independent (the listing should give a Data Dependence message) and that the loop contained I/O statements.

10.4 KAP Listing Messages

Appendix F provides a complete list of the diagnostic messages that can appear in the program listing (original or transformed).

In addition to the listing file, some messages (such as for command switch errors or missing files) are written to the error file. These are intended to be self-explanatory.


Appendix A
Compaq Fortran Extensions Supported by KAP Fortran/OpenMP

Table A-1 shows the Compaq extensions to Fortran.

Table A-1 Compaq Fortran Extensions Supported by KAP Fortran/OpenMP
DIGITAL Fortran 77 Extension Compaq KAP Compaq
Fortran Compiler
Language Elements and Source Form    
END can be continued across lines Yes Yes
99 continuation lines (in free format) Yes Yes
99 continuation lines (in fixed format) Yes Yes
\ treated as escape    
$ allowed in names Yes Yes
ASCII characters x'a1' to x'fe' valid Yes Yes
D debug lines (in fixed form only) Yes Yes
TAB character treated as whitespace Yes Yes
Leading _ allowed in names   Yes
Variable names larger than 31 characters    
Data Types and Attributes    
INTEGER*8, LOGICAL*8 Yes Yes
REAL*16 Yes Yes
Size of the largest character is 2**31 Yes Yes
DOUBLE COMPLEX intrinsic type Yes Yes
*typelength specifier Yes Yes
AUTOMATIC attribute and statement Yes Yes
STATIC attribute and statement Yes Yes
BYTE intrinsic type Yes Yes
BYTE treated same as INTEGER Yes Yes
BYTE treated same as LOGICAL Yes Yes
COMPLEX*32    
Cray POINTER Yes Yes
VIRTUAL attribute and statement Yes Yes
VOLATILE attribute and statement Yes Yes
BYTE treated same as CHARACTER    
Cray style boolean constants    
Cray Character POINTER    
IMPLICIT STATIC and AUTOMATIC Yes  
IMPLICIT UNDEFINED    
VAX STYLE parameter statement Yes Yes
VAX structure, UNION, MAP, RECORD declarations Yes Yes
Constants, Declarations, and Initialization    
Statement function with structure constructor Yes Yes
Hollerith constants in initialization expressions Yes Yes
//Initializer Yes Yes
Equivalence Character and non-Character Yes Yes
Hollerith allowed to initialize COMPLEX Yes Yes
Linear subscript notation in Equivalence Yes Yes
Multiple SAVEs without arguments   Yes
Named constants allowed to initialize COMPLEX Yes Yes
Trailing octal and hexadecimal notation Yes Yes
Typeless character treated as Hollerith Yes Yes
Cray pointee as element in derived type Yes Yes
Cray POINTER as element in derived type    
Cray POINTER with TARGET attribute Yes Yes
Equivalence using sequenced derived types   Yes
Scalar subobject allowed in DATA Yes  
T and F (for .true. and .false. in DATA and intialization expressions)   Yes
Typeless constants in initialization expressions Yes Yes
Array Concepts    
Underindex of arrays   Yes
Overindexing of arrays    
[] form for array constructors   Yes
Array with up to 20 dimension    
Linearized array constructor   Yes
Expressions and Assignment    
.XOR same as .NEQ Yes Yes
Binary constant allowed in arithmetic expression Yes Yes
Bit mask operations on Cray POINTER variables Yes Yes
Bit mask operations on integer constants and variables Yes Yes
Bit mask operations on typeless constants Yes Yes
Hollerith in arithmetic expressions Yes Yes
Hollerith allowed in relational expressions Yes Yes
.A. .O. .N. for .AND. .OR. .NOT. Yes  
Adjacent arithmetic operations Yes Yes
Bit mask operations on real constants and variables    
INTEGER and LOGICAL intermixing Yes Yes
Controlling Execution    
Extended range DO loops Yes Yes
Real can be used in integer contexts like RETURN, computed GOTO, array bounds Yes Yes
& in alternate return (in fixed form only)   Yes
Input and Output Processing    
ENCODE and DECODE I/O statements Yes Yes
Record specifier Yes Yes
Namelist with internal files Yes  
VAX ACCEPT, REWRITE, and DELETE statements Yes Yes
VAX OPEN and CLOSE staement specifiers Yes Yes
VAX TYPE I/O statement Yes Yes
VAX UNLOCK, FIND, and DEFINEFILE statements Yes Yes
Input and Output Editing    
$ edit descriptor Yes Yes
Q data edit_descriptor Yes Yes
S edit descriptor Yes Yes
h edit_descriptor Yes Yes
X without position as edit descriptor Yes Yes
Comma optional in format expression Yes  
Ew.dQe. Qw.d, Fw.dQe edit descriptor Yes Yes
Variable <> format expressions Yes Yes
Non-character format expression Yes Yes
Program Units    
PROGRAM can have argument list Yes  
RETURN as end in main program    
Using Procedures    
%ref and %val Yes Yes
PURE functions   Yes
%loc Yes Yes
References to RECURSIVE FUNCTION name followed by 0 are treated as a function call even when the RESULT is not specified as long as the function is not array valued   Yes
Function result can have SAVE attribute    
Intrinsic Procedures    
MAXLOC and MINLOC accept DIM=argument   Yes
Scope, Association, and Definition    
COMMON block can be initialized outside of BLOCK DATA Yes Yes
Named COMMON in multiple BLOCK DATA Yes Yes
Up to 26 unnamed block data Yes  
COMMON block can have same name as program   Yes


Previous Next Contents Index