JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris Studio 12.3: Fortran User's Guide     Oracle Solaris Studio 12.3 Information Library
search filter icon
search icon

Document Information


1.  Introduction

2.  Using Solaris Studio Fortran

2.1 A Quick Start

2.2 Invoking the Compiler

2.2.1 Compile-Link Sequence

2.2.2 Command-Line File Name Conventions

2.2.3 Source Files

2.2.4 Source File Preprocessors

2.2.5 Separate Compiling and Linking

2.2.6 Consistent Compiling and Linking

2.2.7 Unrecognized Command-Line Arguments

2.2.8 Modules

2.3 Directives

2.3.1 General Directives The C Directive The IGNORE_TKR Directive The UNROLL Directive The WEAK Directive The OPT Directive The PIPELOOP[=n] Directive The PREFETCH Directives The ASSUME Directives

2.3.2 Parallelization Directives OpenMP Parallelization Directives Legacy Sun/Cray Parallelization Directives

2.3.3 IVDEP Directive

2.4 Library Interfaces and

2.5 Compiler Usage Tips

2.5.1 Determining Hardware Platform

2.5.2 Using Environment Variables

2.5.3 Memory Size Swap Space Limits Increasing Swap Space Control of Virtual Memory

2.6 User-Supplied Default Options File

3.  Fortran Compiler Options

4.  Solaris Studio Fortran Features and Extensions

5.  FORTRAN 77 Compatibility: Migrating to Solaris Studio Fortran

A.  Runtime Error Messages

B.  Features Release History

C.  Fortran Directives Summary


2.4 Library Interfaces and

The Fortran compiler provides an include file,, that defines the interfaces for most non-intrinsic library routines. Declare this include file to insure that functions you call and their arguments are properly typed, especially when default data types are changed with -xtypemap.

For example, the following may produce an arithmetic exception because function getpid() is not explicitly typed:

        integer(4) mypid
        mypid = getpid()
        print *, mypid

The getpid() routine returns an integer value but the compiler assumes it returns a real value if no explicit type is declared for the function. This value is further converted to integer, most likely producing a floating-point error.

To correct this you should explicitly type getuid() and functions like it that you call:

        integer(4) mypid, getpid
        mypid = getpid()
        print *, mypid

Problems like these can be diagnosed with the -Xlist (global program checking) option. The Fortran include file ”’ provides explicit interface definitions for these routines.

        include ’’
        integer(4) mypid
        mypid = getpid()
        print *, mypid

Including in program units calling routines in the Fortran library will automatically define the interfaces for you, and help the compiler diagnose type mismatches. (See the Fortran Library Reference for more information.)