HomeContentsPreviousNextIndex

Fortran Programming Guide Sun Microsystems

Contents

 Preface

1.  Introduction

Standards Conformance
Features of the Fortran Compilers
Other Fortran Utilities
Debugging Utilities
Sun Performance Library
Interval Arithmetic
Man Pages
READMEs
Command-Line Help

2.  Fortran Input/Output

Accessing Files From Within Fortran Programs
Accessing Named Files
Opening Files Without a Name
Preconnected Units
Opening Files Without an OPEN Statement
Passing File Names to Programs
f77: VAX / VMS Logical File Names
Direct I/O
Binary I/O
Internal Files
f77: Tape I/O
Using TOPEN Routines
Fortran Formatted I/O for Tape
Fortran Unformatted I/O for Tape
Tape File Representation
End-of-File
Multifile Tapes
Fortran 95 I/O Considerations

3.  Program Development

Facilitating Program Builds With the make Utility
The Makefile
make Command
Macros
Overriding of Macro Values
Suffix Rules in make
Version Tracking and Control With SCCS
Controlling Files With SCCS
Checking Files Out and In

4.  Libraries

Understanding Libraries
Specifying Linker Debugging Options
Generating a Load Map
Listing Other Information
Consistent Compiling and Linking
Setting Library Search Paths and Order
Search Order for Standard Library Paths
LD_LIBRARY_PATH Environment Variable
Library Search Path and Order--Static Linking
Library Search Path and Order--Dynamic Linking
Creating Static Libraries
Tradeoffs for Static Libraries
Creation of a Simple Static Library
Creating Dynamic Libraries
Tradeoffs for Dynamic Libraries
Position-Independent Code and -pic
Binding Options
Naming Conventions
A Simple Dynamic Library
Libraries Provided with Sun Fortran Compilers
VMS Library
POSIX Library
Shippable Libraries

5.  Program Analysis and Debugging

Global Program Checking (-Xlist)
GPC Overview
How to Invoke Global Program Checking
Some Examples of -Xlist and Global Program Checking
Suboptions for Global Checking Across Routines
-Xlist Suboption Reference
Some Examples Using Suboptions
Special Compiler Options
Subscript Bounds (-C)
Undeclared Variable Types (-u)
Version Checking (-V)
Interactive Debugging With dbx and Sun WorkShop
f77: Viewing Compiler Listing Diagnostics

6.  Floating-Point Arithmetic

Introduction
IEEE Floating-Point Arithmetic
-ftrap=mode Compiler Options
Floating-Point Exceptions and Fortran
Handling Exceptions
Trapping a Floating-Point Exception
SPARC: Nonstandard Arithmetic
IEEE Routines
Flags and ieee_flags()
IEEE Extreme Value Functions
Exception Handlers and ieee_handler()
Retrospective Summary
Debugging IEEE Exceptions
Further Numerical Adventures
Avoiding Simple Underflow
Continuing With the Wrong Answer
SPARC: Excessive Underflow
Interval Arithmetic

7.  Porting

Time and Date Functions
Formats
Carriage-Control
Working With Files
Porting From Scientific Mainframes
Data Representation
Hollerith Data
Nonstandard Coding Practices
Uninitialized Variables
Aliasing Across Calls
Obscure Optimizations
Troubleshooting
Results Are Close, but Not Close Enough
Program Fails Without Warning

8.  Performance Profiling

Sun WorkShop Performance Analyzer
The time Command
Multiprocessor Interpretation of time Output
The gprof Profiling Command
Overhead and Other Considerations
The tcov Profiling Command
"Old Style" tcov Coverage Analysis
"New Style" Enhanced tcov Analysis
f77 I/O Profiling

9.  Performance and Optimization

Choice of Compiler Options
Performance Option Reference
Other Performance Strategies
Using Optimized Libraries
Eliminating Performance Inhibitors
Further Reading

10.  SPARC: Parallelization

Essential Concepts
Speedups--What to Expect
Steps to Parallelizing a Program
Data Dependency Issues
Parallel Options and Directives Summary
Number of Threads
Stacks, Stack Sizes, and Parallelization
Automatic Parallelization
Loop Parallelization
Arrays, Scalars, and Pure Scalars
Automatic Parallelization Criteria
Automatic Parallelization With Reduction Operations
Explicit Parallelization
Parallelizable Loops
Sun-Style Parallelization Directives
Cray-Style Parallelization Directives
Environment Variables
PARALLEL and OMP_NUM_THREADS
SUNW_MP_THR_IDLE
Debugging Parallelized Programs
First Steps at Debugging
Debugging Parallel Code With dbx

11.  C-Fortran Interface

Compatibility Issues
Function or Subroutine?
Data Type Compatibility
Case Sensitivity
Underscores in Routine Names
Argument-Passing by Reference or Value
Argument Order
Array Indexing and Order
File Descriptors and stdio
File Permissions
Libraries and Linking With the f77 or f95 Command
Fortran Initialization Routines
Passing Data Arguments by Reference
Simple Data Types
COMPLEX Data
Character Strings
One-Dimensional Arrays
Two-Dimensional Arrays
Structures
Pointers
Passing Data Arguments by Value
Functions That Return a Value
Returning a Simple Data Type
Returning COMPLEX Data
Returning a CHARACTER String
Labeled COMMON
Sharing I/O Between Fortran and C
Alternate Returns

 Index


Sun Microsystems, Inc.
Copyright information. All rights reserved.
Feedback
Library   |   Contents   |   Previous   |   Next   |   Index