Skip Navigation Links | |
Exit Print View | |
Oracle Solaris Studio 12.3: Fortran User's Guide Oracle Solaris Studio 12.3 Information Library |
2. Using Solaris Studio Fortran
4. Solaris Studio Fortran Features and Extensions
4.1.1 Continuation Line Limits
4.2.1.1 Rules Governing Boolean Type
4.2.1.2 Alternate Forms of Boolean Constants
4.2.1.3 Alternate Contexts of Boolean Constants
4.2.2 Abbreviated Size Notation for Numeric Data Types
4.2.3 Size and Alignment of Data Types
4.3.2 Purpose of Cray Pointers
4.3.3 Declaring Cray Pointers and Fortran 95 Pointers
4.3.4 Features of Cray Pointers
4.3.5 Restrictions on Cray Pointers
4.3.6 Restrictions on Cray Pointees
4.4 STRUCTURE and UNION (VAX Fortran)
4.6.2 IEEE Floating-Point Exception Handling
4.6.3 Command-Line Argument Intrinsics
4.6.5 Fortran 2003 Asynchronous I/O
4.6.6 Extended ALLOCATABLE Attribute
4.6.9 Fortran 2003 IMPORT Statement
4.6.10 Fortran 2003 FLUSH I/O Statement
4.6.11 Fortran 2003 POINTER INTENT Feature
4.6.12 Fortran 2003 Enhanced Array Constructor
4.6.13 Object-Oriented Fortran Support
4.6.14 Additional Fortran 2003 and Fortran 2008 Features
4.7.1 I/O Error Handling Routines
4.7.2 Variable Format Expressions
4.7.5 Miscellaneous I/O Extensions
4.9.2 The -use=list Option Flag
5. FORTRAN 77 Compatibility: Migrating to Solaris Studio Fortran
A compiler directive directs the compiler to do some special action. Directives are also called pragmas.
A compiler directive is inserted into the source program as one or more lines of text. Each line looks like a comment, but has additional characters that identify it as more than a comment for this compiler. For most other compilers, it is treated as a comment, so there is some code portability.
A complete summary of Fortran directives appears in Appendix C, Fortran Directives Summary.
f95 recognizes its own special directives in addition to those described in 1.8 Command-Line Help. These have the following syntax:
!DIR$ d1, d2, …
Directives are listed in columns 7 and beyond.
Columns beyond 72 are ignored.
An initial directive line has a blank in column 6.
A continuation directive line has a nonblank in column 6.
Put !DIR$ followed by a space anywhere in the line.
The !DIR$ characters are the first nonblank characters in the line (actually, non-whitespace).
Directives are listed after the space.
An initial directive line has a blank, tab, or newline in the position immediately after the !DIR$.
A continuation directive line has a character other than a blank, tab, or newline in the position immediately after the !DIR$.
Thus, !DIR$ in columns 1 through 5 works for both free-form source and fixed-form source.
These directives specify the source form of lines following the directive line.
They apply to the rest of the file in which they appear, or until the next FREE or FIXED directive is encountered.
They allow you to switch source forms within a source file.
They allow you to switch source forms for an INCLUDE file. You insert the directive at the start of the INCLUDE file. After the INCLUDE file has been processed, the source form reverts back to the form being used prior to processing the INCLUDE file.
Each must appear alone on a compiler directive line (not continued).
Each can appear anywhere in your source code. Other directives must appear within the program unit they affect.
Example: A FREE directive.
!DIR$ FREE DO i = 1, n a(i) = b(i) * c(i) END DO
A parallelization directive is a special comment that directs the compiler to attempt to parallelize the next DO loop. These are summarized in Appendix D and described in the chapter on parallelization in the Fortran Programming Guide. Both Sun and Cray style parallelization directives are now deprecated as obsolete., The OpenMP Fortran API directives and parallelization model is preferred. OpenMP parallelization is described in the OpenMP API User’s Guide.