Fortran User's Guide
只搜尋這本書
以 PDF 格式下載這本書 (349 KB)

Preface

This guide describes the compile-time environment and command-line options for the two Sun(TM)TM Fortran compilers: f77 (FORTRAN 77 version 5.0) and f90 (Fortran 90 version 2.0). Runtime error messages and new features of the compilers are listed in appendixes.

Discussion of Fortran programming issues on Solaris(TM) operating environments, including input/output, application development, library creating and use, program analysis, porting, optimization, and parallelization can be found in the companion Sun Fortran Programming Guide.


Note -

This guide covers the Sun FORTRAN 77 and Fortran 90 compilers. The text uses "f77/f90" and "Fortran" to indicate information that is common to both compilers.


Who Should Use This Book

This guide is intended for scientists, engineers, and programmers who have a working knowledge of the Fortran language and wish to learn how to use the Sun Fortran compilers effectively. Familiarity with the Solaris(TM) operating environment or UNIX\256© in general is also assumed.

How This Book Is Organized

This guide is organized into the following chapters and appendixes:

  • Chapter 1, "Introduction," briefly describes the features of the compilers.

  • Chapter 2, "Using Sun Fortran Compilers," discusses the compiler environments.

  • Chapter 3, "Sun Fortran Compiler Options," gives detailed descriptions of all the compile-time command-line options and flags.

  • Appendix A, "Runtime Error Messages," lists error messages issued by the Fortran runtime library and operating environment.

  • Appendix B, "Feature Release History," notes new features of the compilers and changes in recent releases.

  • Appendix C, "Fortran 90 Features and Differences," describes the differences between the Sun f90 compiler and the Fortran 90 standard.

  • Appendix D, "-xtarget Platform Extensions," lists all the platform system names accepted by the compiler -xtarget option.

Multiplatform Release


Note -

The name of the latest Solaris operating environment release is Solaris 7 but some documentation and path or package path names may still use Solaris 2.7 or SunOS 5.7.


The Sun Fortran documentation covers the release of the Fortran compilers on a number of operating environments and hardware platforms:

FORTRAN 77 5.0 is released for:

  • Solaris 2.5.1, 2.6, and Solaris 7 environments on:

    • architectures based on the SPARC(TM) microprocessor

    • x86-based architectures, where x86 refers to the Intel\256TM implementation of one of the following: Intel 80386(TM), Intel 80486(TM), Pentium(TM), or the equivalent

Fortran 90 2.0 is released for:

  • Solaris 2.5.1, 2.6, and Solaris 7 environments on SPARC processors only.


    Note -

    The term "x86" refers to the Intel 8086 family of microprocessor chips, including the Pentium, Pentium Pro, and Pentium II processors and compatible microprocessor chips made by AMD and Cyrix. In this document, the term "x86" refers to the overall platform architecture. Features described in this book that are particular to a specific platform are differentiated by the terms "SPARC" and "x86" in the text.


Related Books

The following books augment this manual and provide essential information:

  • Fortran Programming Guide. Discusses issues relating to input/output, libraries, program analysis, debugging, and performance.

  • FORTRAN 77 Language Reference. Complete language reference.

  • Fortran Library Reference-gives details on the language and routines.

  • Sun Performance WorkShop Fortran Overview gives a high-level outline of the Fortran package suite.

Other Programming Books

  • C User's Guide--describes compiler options, pragmas, and more.

  • Numerical Computation Guide--details floating-point computation and numerical accuracy issues.

  • Sun WorkShop Performance Library Reference-discusses the library of subroutines and functions to perform useful operations in computational linear algebra and Fourier transforms.

Other Sun WorkShop Books

  • Sun WorkShop Quick Install-provides installation instructions.

  • Sun WorkShop Installation Reference-provides supporting installation and licensing information.

  • Sun Visual WorkShop C++ Overview-gives a high-level outline of the C++ package suite.

  • Using Sun WorkShop--gives information on performing development operations through Sun WorkShop.

  • Debugging a Program With dbx--provides information on using dbx commands to debug a program.

  • Analyzing Program Performance with Sun WorkShop--describes the profiling tools; LoopTool, LoopReport, LockLint utilities; and the Sampling Analyzer to enhance program performance.

  • Sun WorkShop TeamWare User's Guide--describes how to use the Sun WorkShop TeamWare code management tools.

Solaris Books

The following Solaris manuals and guides provide additional useful information:

  • The Solaris Linker and Libraries Guide--gives information on linking and libraries.

  • The Solaris Programming Utilities Guide--provides information for developers about the special built-in programming tools available in the SunOS system.

Ordering Sun Documents

The SunDocsSM program provides more than 250 manuals from Sun Microsystems, Inc. If you live in the United States, Canada, Europe, or Japan, you can purchase documentation sets or individual manuals using this program.

For a list of documents and how to order them, see the catalog section of the SunExpressTM Internet site at http://www.sun.com/sunexpress.

Accessing Sun Documents Online

Sun WorkShop documentation is available online from several sources:

  • The docs.sun.com Web site

  • AnswerBook2TM collections

  • HTML documents

  • Online help and release notes

Using the docs.sun.com Web site

The docs.sun.com Web site enables you to access Sun technical documentation online. You can browse the docs.sun.com archive or search for a specific book title or subject. The URL is http://docs.sun.com.

Accessing AnswerBook2 Collections

The Sun WorkShop documentation is also available using AnswerBook2 software. To access the AnswerBook2 collections, your system administrator must have installed the AnswerBook2 documents during the installation process (if the documents are not installed, see your system administrator or Chapter 3 of Sun WorkShop Quick Install for installation instructions). For information about accessing AnswerBook2 documents, see Chapter 6 of Sun WorkShop Quick Install, Solaris installation documentation, or your system administrator.


Note -

To access AnswerBook2 documents, Solaris 2.5.1 users must first download AnswerBook2 documentation server software from a Sun Web page. For more information, see Chapter 6 of Sun WorkShop Quick Install.


Accessing HTML Documents

The following Sun Workshop documents are available online only in HTML format:

  • Tools.h++ Class Library Reference

  • Tools.h++ User's Guide

  • Numerical Computation Guide

  • Standard C++ Library User's Guide

  • Standard C++ Class Library Reference

  • Sun WorkShop Performance Library Reference Manual

  • Sun WorkShop Visual User's Guide

  • Sun WorkShop Memory Monitor User's Manual

To access these HTML documents:

  1. Open the following file through your HTML browser:

    install-directory/SUNWspro/DOC5.0/lib/locale/C/html/index.html

    Replace install-directory with the name of the directory where your Sun WorkShop software is installed (the default is /opt).

    The browser displays an index of the HTML documents for the Sun WorkShop products that are installed.

  2. Open a document in the index by clicking the document's title.

Accessing Sun WorkShop Online Help and Release Notes

This release of Sun WorkShop includes an online help system as well as online manuals. To find out more see:

  • Online Help. A help system containing extensive task-oriented, context-sensitive help. To access the help, choose Help Help Contents. Help menus are available in all Sun WorkShop windows.

  • Release Notes. The Release Notes contain general information about Sun WorkShop and specific information about software limitations and bugs. To access the Release Notes, choose Help Release Notes.

  • You can view the latest release information regarding the Fortran compilers by invoking a compiler with the -xhelp=readme flag.

What Typographic Changes Mean

The following table describes the typographic changes used in this book.

Table P-1 Typographic Conventions

Typeface or Symbol

Meaning

Example

AaBbCc123

The names of commands, files, and directories; on-screen computer output

Edit your .login file.

Use ls -a to list all files.

machine_name% You have mail.

AaBbCc123

What you type, contrasted with on-screen computer output

machine_name% su

Password:

AaBbCc123

Command-line placeholder:

replace with a real name or value

To delete a file, type rm filename.

AaBbCc123

Book titles, new words or terms, or words to be emphasized

Read Chapter 6 in User's Guide. These are called class options.

You must be root to do this.

Shell Prompts in Command Examples

The following table shows the default system prompt and superuser prompt for the C shell, Bourne shell, and Korn shell.

Table P-2 Shell Prompts

Shell

Prompt

C shell prompt

machine_name%

C shell superuser prompt

machine_name#

Bourne shell and Korn shell prompt

$

Bourne shell and Korn shell superuser prompt

#

Other Conventions Used in This Book

The following conventions appear in the text of this book:

  • Code listings and examples appear in boxes:


    	WRITE( *, * ) 'Hello world'

  • The symbol ¤ stands for a blank space where a blank is significant:


     ¤¤36.001

  • FORTRAN 77 examples appear in tab format, while Fortran 90 examples appear in free format. Examples common to both FORTRAN 77 and 90 use tab format except where indicated.

  • Uppercase characters are generally used to show Fortran keywords and intrinsics (PRINT), and lowercase or mixed case is used for variables (TbarX).

  • The Sun Fortran compilers are referred to by their command names, either f77 or f90. "f77/f90" indicates information that is common to both the FORTRAN 77 and Fortran 90 compilers.

  • References to online man pages appear with the topic name and section number. For example, a reference to GETENV will appear as getenv(3F), implying that the man command to access this page would be:    man -s 3F getenv

  • System Administrators may install the Sun Fortran compilers and supporting material at: <install_point>/SUNWspro/SC5.0/ where <install_point> is usually /opt for a standard install. This is the location assumed in this book.