Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Fortran Compiler for HP-UX: HP Fortran Programmer's Reference > Chapter 2 Language elements

Statements

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

All HP Fortran statements are fully described in alphabetical order in Chapter 10, “HP Fortran Statements.”

The required order for statements in a standard Fortran 90 program unit is illustrated in Table 2-2 “Statement order in a program unit”. Vertical lines separate statements that can be interspersed, and horizontal lines separate statements that cannot be interspersed. For example, the DATA statement can appear among executable statements but may not be interspersed with CONTAIN statements. Also, the USE statement, if present, must immediately follow the program unit heading.

Table 2-2 Statement order in a program unit

PROGRAM, FUNCTION, SUBROUTINE, MODULE, or BLOCK DATA statement
USE statement
 IMPLICIT NONE statement
 PARAMETER statementIMPLICIT statement
FORMAT Derived-type definitions,
andPARAMETER andInterface blocks,
ENTRYDATA statementsType declarations,
statements Statement functions, and
  Specification statements
 DATA statementsExecutable constructs
CONTAINS statement
Internal subprograms or module subprograms
END statement

 

Table 2-2 “Statement order in a program unit” does not show where comments, the INCLUDE line, and directives may appear. Comments may appear anywhere in a source file, including after the END statement. The INCLUDE line may appear anywhere before the END PROGRAM statement.

Table 2-3 “Statements allowed in scoping units” identifies which statements may appear within a scoping unit; a check mark indicates that a statement is allowed in the specified scoping unit. For the purpose of this table, type declarations include the PARAMETER statement, the IMPLICIT statement, type declaration statements, derived-type definitions, and specification statements.

Table 2-3 Statements allowed in scoping units

 Scoping units
StatementsMain programExternal
procedure
ModuleModule
procedure
Internal
procedure
Interface
body
Block data
program unit
CONTAINS   
DATA 
ENTRY     
Executable   
FORMAT   
Interface block 
Statement function   
Type declaration
USE

 

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.