Fortran Programming Guide |
Introduction
The Sun Fortran compilers,
f77
andf95
, described in this book (and the companion book Sun Fortran User's Guide) are available under the Solaris operating environment on the various hardware platforms that Solaris supports. The compilers themselves conform to published Fortran language standards, and provide many extended features, including multiprocessor parallelization, sophisticated optimized code compilation, and mixed C/Fortran language support.The compilers are components of the Sun Performance WorkShopTM 6. The Fortran 90 compiler,
f90
, of previous releases of the Sun Performance WorkShop has been renamedf95
in Sun WorkShop 6. Thef90
command is now an alias forf95
-- both invoke the Sun Performance WorkShop 6 Fortran 95 compiler.Standards Conformance
f77
was designed to be compatible with the ANSI X3.9-1978 Fortran standard and the corresponding International Organization for Standardization (ISO) 1539-1980, as well as standards FIPS 69-1, BS 6832, and MIL-STD-1753.f95
was designed to be compatible with the ANSI X3.198-1992, ISO/IEC 1539:1991, and ISO/IEC 1539:1997 standards documents.- Floating-point arithmetic for both compilers is based on IEEE standard 754-1985, and international standard IEC 60559:1989.
- On SPARC platforms, both compilers provide support for the optimization-exploiting features of SPARC V8, and SPARC V9, including the UltraSPARCTM implementation. These features are defined in the SPARC Architecture Manuals, Version 8 (ISBN 0-13-825001-4), and Version 9 (ISBN 0-13-099227-5), published by Prentice-Hall for SPARC International.
- In this document, "Standard" means conforming to the versions of the standards listed above. "Non-standard" or "Extension" refers to features that go beyond these versions of these standards.
The responsible standards bodies may revise these standards from time to time. The versions of the applicable standards to which these compilers conform may be revised or replaced, resulting in features in future releases of the Sun Fortran compilers that create incompatibilities with earlier releases.
Features of the Fortran Compilers
Sun Fortran compilers provide the following features or extensions:
f77:
Global program checking across routines for consistency of arguments, commons, parameters, and the like.- SPARC only: Support for multiprocessor systems, including automatic and explicit loop parallelization, is integrated tightly with optimization.
Note Parallelization features of the Fortran compilers require a Sun WorkShop HPC license.
f77
: Many VAX/VMS Fortran 5.0 extensions, including:
NAMELIST
DO
WHILE
- Structures, records, unions, maps
- Variable format expressions
- Recursion
- Pointers
- Double-precision complex
- SPARC: Quadruple-precision real
- SPARC: Quadruple-precision complex
- Cray-style parallelization directives, including TASK COMMON, with extensions for
f95
.- OpenMP parallelization directives accepted by
f95.
- Global, peephole, and potential parallelization optimizations produce high performance applications. Benchmarks show that optimized applications can run significantly faster when compared to unoptimized code.
- Common calling conventions on Solaris systems permit routines written in C or C++ to be combined with Fortran programs.
- Support for 64-bit Solaris environments on UltraSPARC platforms.
- Call-by-value,
%VAL
, implemented in bothf77
andf95
.- Interoperability between Fortran 77 and Fortran 95 programs and object binaries.
- Interval Arithmetic expressions in
f95
.Other Fortran Utilities
The following utilities provide assistance in the development of software programs in Fortran:
- Sun WorkShop Performance Analyzer -- In depth performance analysis tool for single threaded and multi-threaded applications. See
analyzer
(1).asa
-- This Solaris utility is a Fortran output filter for printing files that have Fortran carriage-control characters in column one. Use asa to transform files formatted with Fortran carriage-control conventions into files formatted according to UNIX line-printer conventions. Seeasa
(1).fpp
-- A Fortran source code preprocessor. Seefpp
(1).fsplit
-- This utility splits one Fortran file of several routines into several files, each with one routine per file. Usefsplit
on FORTRAN 77 or Fortran 95 source files. Seefsplit
(1)Debugging Utilities
The following debugging utilities are available:
error
-- (f77 only) A utility to merge compiler error messages with the Fortran 77 source file. (This utility is included if you do a developer install, rather than an end user install of Solaris; it is also included if you install theSUNWbtool
package.)-Xlist
--A compiler option to check across routines for consistency of arguments, COMMON blocks, and so on.- Sun WorkShop --Provides a visual debugging environment based on
dbx
and includes a data visualizer and performance data collector.Sun Performance Library
The Sun Performance LibraryTM is a library of optimized subroutines and functions for computational linear algebra and Fourier transforms. It is based on the standard libraries LAPACK, BLAS, FFTPACK, VFFTPACK, and LINPACK.
Each subprogram in the Sun Performance Library performs the same operation and has the same interface as the standard library versions, but is generally much faster and possibly more accurate.
See the
performance_library
README file, and the Sun Performance Library User's Guide for details.Interval Arithmetic
This release of the Fortran 95 compiler introduces two new compiler flags,
-xia
and-xinterval
that enable the compiler to recognize new language extensions and generate the appropriate code to implement interval arithmetic computations.See the Interval Arithmetic Programming Reference for details.
Man Pages
On-line manual (
man
) pages provide immediate documentation about a command, function, subroutine, or collection of such things.Sun WorkShop man pages are located in install_directory
/SUNWspro/man/
. (In a normal install of the Sun WorkShop, install_directory is /opt
.) Add this path to your MANPATH environment variable to access these Sun WorkShop man pages. (See the Fortran User's Guide for details.)You can display a man page by running the command:
demo%man
topicThroughout the Fortran documentation, man page references appear with the topic name and man section number:
f77
(1) is accessed withman f77
. Other sections, denoted byieee_flags
(3M) for example, are accessed using the-s
option on theman
command:
demo%man -s 3M ieee_flags
Man pages for the Fortran library routines are found in section 3F.
The following lists
man
pages of interest to Fortran user:
READMEs
The
READMEs
directory contains files that describe new features, software incompatibilities, bugs, and information that was discovered after the manuals were printed. The location of this directory depends on where your software was installed. The path is: install_directory/SUNWspro/READMEs/
. In a normal install, install_directory is/opt
.
The READMEs for all compilers are easily accessed by the
-xhelp=readme
command-line option. For example, the command:
f95 -xhelp=readme
will display the
fortran_95
README file directly.Command-Line Help
You can view very brief descriptions of the
f77
andf90
command line options by invoking the compiler's-help
option as shown below:
Sun Microsystems, Inc. Copyright information. All rights reserved. Feedback |
Library | Contents | Previous | Next | Index |