CONTENTS
1 OVERVIEW
1.1 GENERAL RULES
Statements
Program Units
Compiling, Linking and Running Programs
Order of Statements
Character Set
Lines and Fields
1.2 A FEW BASIC STATEMENTS
PROGRAM Statement
PRINT Statement
STOP Statement
END Statement
1.3 EXAMPLE PROGRAM
1.4 FORTRAN 90 FEATURES
Overview
Source Form
Fixed Source Form
Free Source Form
1.5 SUMMARY
CHAPTER 1--PROBLEMS
2 BASIC INPUT/OUTPUT
2.1 RECORDS AND FILES
2.2 UNITS AND FILE CONNECTION
2.3 READ STATEMENT
2.4 WRITE STATEMENT
2.5 UNFORMATTTED INPUT/OUTPUT RULES
2.6 OPEN STATEMENT
2.7 CLOSE STATEMENT
2.8 DATA STATEMENT
2.9 DEBUGGING TOOLS
2.10 EXAMPLE PROGRAMS
Example 1: Use of DATA Statement and Connection to an
Output File (for later printing)
Example 2: Connection to Input and Output Files
Example 3: Direct Screen Input and Output
Example 4: Direct Screen Input with Formatted Input Prompts
2.11 SUMMARY
CHAPTER 2--PROBLEMS
3 DECLARATION STATEMENTS
3.1 INTEGER STATEMENT
3.2 REAL STATEMENT
3.3 COMPLEX STATEMENT
Complex Uniformatted Input/Output
3.4 DOUBLE PRECISION STATEMENT
Double-precision Unformatted Input/Output
3.5 LOGICAL STATEMENT
Logical Unformatted Input/Output
3.6 CHARACTER STATEMENT
Character Variable Input/Output
Example Program
CHARACTER Variable Example Program:
Printing A Banner
3.7 DECLARATION STATEMENTS IN
FORTRAN 90
3.9 SUMMARY
CHAPTER 3--PROBLEMS
4 CONDITIONAL STATEMENTS
4.1 LOGICAL EXPRESSIONS
4.2 BLOCK IF CONSTRUCT
Nested Block IF Constructs
4.3 LOGICAL IF STATEMENT
4.4 GO TO AND CONTINUE STATEMENTS
GO TO Statement
CONTINUE Statement
GO TO-CONTINUE Loops
4.5 ARITHMETIC IF STATEMENT
4.6 EXAMPLE PROGRAMS
Example 1: Logical Expressions
Example 2: Nested Block IF Construct
4.7 SUMMARY
CHAPTER 4--PROBLEMS
5 ASSIGNMENT STATEMENTS
Definition
5.1 CONSTANTS
Integer Constants
Real Constants
Double-Precision Constants
Complex Constants
Logical Constants
Character Constants
5.2 ASSIGNMENT STATEMENTS
Arithmetic Assignment Statement
Logical Assignment Statement
Character Assignment Statement
5.3 OPERATIONS
Arithmetic Operations
Rank of Arithmetic Data Types
Logical Operations
Character Linking
5.4 INTRINSIC FUNCTIONS
5.5 EXAMPLE PROGRAMS
Example 1: Assignment Statements
Example 2: Tic-Tac-Toe Board
5.6 SUMMARY
CHAPTER 5--PROBLEMS
6 FORMATTED INPUT/OUTPUT
6.1 FORMAT STATEMENT
6.2 FIELD AND EDIT DESCRIPTORS
Integer Field Descriptor I
Real Field Descriptor F
Real Field Descriptor E
Real Field Descriptor D
Logical Field Descriptor L
Character Field Descriptor A
Character Field Descriptor H
Edit Descriptor X
Edit Descriptor T
Edit Descriptor $
Carriage Control
Repeat Count of Field Descriptors
Output Statement Record Overflow
6.3 OTHER FORMAT TOPICS
Interaction of Input/Output Statements with
Format Statements
Runtime Formats
Variable Formats
6.4 EXAMPLE PROGRAMS
Example 1: Table of Trigonometric Functions
Example 2: Variable Formats
6.5 SUMMARY
CHAPTER 6--PROBLEMS
7 DO LOOPS
7.1 INDEXED DO STATEMENT
DO Iteration Control
Transfer of Control in Block DO Constructs
Rules for Control Variable in Block DO
Constructs
DO Loops and Fortran 90
7.2 DO WHILE STATEMENT
Nested DO WHILE Loops
7.3 EXAMPLE PROGRAMS
Example 1: Table of Trigonometric Functions
Using a DO Loop
Example 2: Tic-Tac-Toe Board Using a
DO Loop and Block IF
Example 3: Tic-Tac-Toe Board Using a
DO WHILE Loop and Nested Block IF
7.4 SUMMARY
CHAPTER 7--PROBLEMS
8 SUBSCRIPTED VARIABLES
8.1 ARRAY SPECIFICATION
Specification of Integer or Real Arrays
that are Declared Implicitly
Specification of Integer or Real Arrays
that are Declared Explicitly
Arrays of Logical and Character Type
Lower and Upper Bounds of Arrays
8.2 PARAMETER STATEMENT
8.3 SEQUENCE OF STATEMENTS IN
SPECIFICATION BLOCK
Sizing DIMENSION Statements with
Parameters
8.4 INPUT/OUTPUT OF ARRAYS
Implied DO Lists in READ/WRITE Statements
Combined Implied DO Lists and
Explicit DO Loops
8.5 LIST-TO-FORMAT INTERACTION
Interaction of Implied DO Lists with
FORMAT Statements
Interaction of Implied DO Lists with
Unformatted READ and WRITE
Interaction of Combined Implied DO Lists and
Explicit DO Loops with FORMAT Statements
Interaction of Combined Implied DO Lists and
Explicit DO Loops with Unformatted
READ and WRITE
8.6 IMPLIED DO LISTS IN DATA STATEMENTS
8.7 SORTING OF ARRAYS:
THE BUBBLE SORT
8.8 EXAMPLE PROGRAMS
Matrix Multiplication
8.9 SUMMARY
CHAPTER 8--PROBLEMS
9 FUNCTIONS AND SUBROUTINES
9.1 STATEMENT FUNCTIONS
9.2 FUNCTIONS
9.3 SUBROUTINES
9.4 COMMON STATEMENT
9.5 ADJUSTABLE ARRAYS
Local vs Global Variables
9.6 EXTERNAL AND INTRINSIC STATEMENTS
9.7 SUMMARY
CHAPTER 9--PROBLEMS
10 ADDITIONAL FEATURES
10.1 TRANSFER OF CONTROL IN
INPUT/OUTPUT
10.2 COMPLEX INTRINSIC FUNCTIONS
Complex Arithmetic
Operations with Complex Numbers
10.3 CHARACTER MANIPULATION
Character Substrings
Character Intrinsic Functions
Lexical Comparison Intrinsic Functions
CHAPTER 10--PROBLEMS
11 MISCELLANEOUS STATEMENTS
11.1 ASSIGN STATEMENT
11.2 COMPUTED GO TO STATEMENT
11.3 BACKSPACE STATEMENT
11.4 BLOCK DATA SUBPROGRAM
11.5 EQUIVALENCE STATEMENT
11.6 IMPLICIT STATEMENT
11.7 PAUSE STATEMENT
11.8 REWIND STATEMENT