This Appendix lists the new and changed features in this release and previous releases of the Fortran 95 compiler.

The Fortran 95 compiler, version 8.2, is a component released with Sun Studio 11.

B.1 Sun Studio 11 Fortran Release

New -xmodel option:
The new -xmodel option lets you specify the kernel, small, or medium memory models on the 64-bit AMD architecture. If the size of your global and static variables exceeds two gigabytes, specify -xmodel=medium. Otherwise, use the default -xmodel=small setting. See -xmodel=[small | kernel | medium].

STACKSIZE environment variable enhanced:
The syntax of the STACKSIZE environment variable has been enhanced to include a units keyword.

-xpagesize options available on x86 platforms:
Options -xpagesize, -xpagesize_heap, and -xpagesize_stack are now enabled on x86 platforms as well as SPARC. See -xpagesize=size.

New UltraSPARC T1 and UltraSPARC IV+ targets enabled:
Values for -xarch, -xchip, -xcache, and -xtarget support new UltraSPARC processors. See -xtarget=t.

B.2 Sun Studio 10 Fortran Release:

Compiling for AMD-64 Processors

This release introduces -xarch=amd64 and -xtarget=opteron for compiling applications to run on 64-bit x86 platforms.

File sharing between big-endian and little-endian platforms

The new compiler flag -xfilebyteorder provides cross-platform support of binary I/O files.

OpenMP available on Solaris OS x86 platforms

With this release of Sun Studio, the OpenMP API for shared-memory parallelism is available on Solaris x86 platforms as well as Solaris SPARC platforms. The same functionality is now enabled on both platforms.

OpenMP option -openmp=stubs no longer supported

An OpenMP "stubs" library is provided for user's convenience. To compile an OpenMP program that calls OpenMP library functions but ignores the OpenMP pragmas, compile the program with the -openmp option and link the object files with the libompstubs.a library. For example:
% f95 omp_ignore.c -lompstubs

Linking with both libompstubs.a and the OpenMP runtime library libmtsk.so is unsupported and may result in unexpected behavior.

Runtime performance for most applications should improve significantly with this release. For best results, compile with high optimization levels -xO4 or -xO5. At these levels the compiler may now inline contained procedures, and those with assumed-shape, allocatable, or pointer arguments.

Fortran 2003 Command-Line Intrinsics:

The Fortran 2003 draft standard introduces three new intrinsics for processing command-line arguments and environment variables. These have been implemented in this release of the f95 compiler. The new intrinsics are:

GET_COMMAND(command, length, status)

Returns in command the entire command line that invoked the program.

GET_COMMAND_ARGUMENT(number, value, length, status)

Returns a command-line argument in value.

GET_ENVIRONMENT_VARIABLE(name, value, length, status, trim_name)

Return the value of an environment variable.

New and Changed Command-Line Options:

The following f95 command-line options are new in this release. See the Chapter 3 for details.

Set path mapping for profile data files. Use the -xprofile_pathmap option with the -xprofile=use option when profiling into a directory that is not the directory used when previously compiling with -xprofile=collect.

The following command-line option defaults have changed with this release of f95.

The default for -xprefetch is -xprefetch=no%auto,explicit.

The default for -xmemalign is -xmemalign=8i; when compiling with one of the -xarch=v9 options the default is -xmemalign=8f.

The default for -xcode when compiling with one of the -xarch=v9 options is abs44.

To compile with the defaults used in previous compiler releases, specify the following options explicitly:

The default SPARC architecture is no longer V7. Support for -xarch=v7 is limited in this Sun Studio 9 release. The new default is V8PLUS (UltraSPARC). Compiling with -xarch=v7 is treated as -xarch=v8 because the Solaris 8 OS only supports -xarch=v8 or better.

To deploy on SPARC V8 systems (for example, SPARCStation 10), compile with -xarch=v8 explicitly. The provided system libraries run on SPARC V8 architectures.

To deploy on SPARC V7 systems (for example, SPARCStation 1), compile with -xarch=v7 explicitly. The provided system libraries use the SPARC V8 instruction set. For the Sun Studio 9 release, only the Solaris 8 OS supports the SPARC V7 architecture. When a SPARC V8 instruction is encountered, the OS interprets the instruction in software. The program will run, but performance will be degraded.

OpenMP: Maximum Number of Threads Increased:

The maximum number of threads for OMP_NUM_THREADS and the multitasking library has increased from 128 to 256.

OpenMP: Automatic Scoping of Variables:

This release of the Fortran 95 compiler's implementation of the OpenMP API for shared-memory parallel programming features automatic scoping of variables in parallel regions. See the OpenMP API User's Guide for details. (OpenMP is only implemented on SPARC platforms for this release.)

B.4 Sun Studio 8 Fortran Release:

Enhanced -openmp option:

The -openmp option flag has been enhanced to facilitate debugging OpenMP programs. To use dbx to debug your OpenMP application, compile with

Specify -xjobs=n with -xipo and the interprocedural optimizer will invoke at most n code generator instances to compile the files listed on the command line. This option can greatly reduce the build time of large applications on a multi-cpu machine. See Section , -xjobs=n.

Making assertions with PRAGMAASSUME:

The ASSUME pragma is a new feature in this release of the compiler. This pragma gives hints to the compiler about conditions the programmer knows are true at some point in a procedure. This may help the compiler to do a better job optimizing the code. The programmer can also use the assertions to check the validity of the program during execution. See Section 2.3.1.9, The ASSUME Directives, and Section , -xassume_control[=keywords].

More Fortran 2000 features:

The following features appearing in the Fortran 2000 draft standard have been implemented in this release of Fortran 95 compiler. These are described in Chapter 4.

The new draft standard for Fortran provides a means of referencing C language procedures and, conversely, a means of specifying that a Fortran subprogram can be referenced from a C function. It also provides a means of declaring global variables that are linked with external C variables. See Section 4.6.1, Interoperability with C Functions.

PROTECTED Attribute

The Fortran 95 compiler now accepts the Fortran 2000 PROTECTED attribute. PROTECTED imposes limitations on the usage of module entities. Objects with the PROTECTED attribute are only definable within the module that declares them. Section 4.6.4, PROTECTED Attribute.

A number of new features enhance the Fortran 95 compiler's compatibility with legacy Fortran 77 compiler, f77. These include variable format expressions (VFE's), long identifiers, -arg=local , and the -vax compiler option. See Chapter 3 and Chapter 4.

I/O error handlers:

Two new functions enable the user to specify their own error handling routine for formatted input on a logical unit. These routines are described in Section 4.7.1, I/O Error Handling Routines, and in man pages and the Fortran Library Reference.

Compile and link with the new -xlinkopt flag to invoke a post-optimizer to apply a number of advanced performance optimizations on the generated binary object code at link time. See Section , -xlinkopt[={1|2|0}].

Initialization of local variables:

A new extension to the -xcheck option flag enables special initialization of local variables. Compiling with -xcheck=init_local initializes local variables to a value that is likely to cause an arithmetic exception if it is used before it is assigned by the program. See Section , -xcheck=keyword

This release of the Forte Developer software replaces the f77 compiler with added functionality in the f95 compiler. The f77 command is a script that calls the f95 compiler:

the command:

f77 optionsfileslibraries

becomes a call to the f95 compiler::

f95 -f77=%all -ftrap=%none optionsfiles -lf77compat libraries

See Chapter 5 for details on Fortran 77 compatibilities and incompatibilities.

Fortran 77 Compatibility Mode:

The new -f77 flag selects various compatibility features that enable the compiler to accept many Fortran 77 constructs and conventions that are normally incompatible with Fortran 95. See Section , -f77[=list], and Chapter 5.

Compiling "Dusty Deck" Programs That Employ Non-Standard Aliasing:

The f95 compiler must assume that programs it compiles adhere to the Fortran 95 standard regarding aliasing of variables through subprogram calls, global variables, pointers, and overindexing. Many "dusty deck" legacy programs intentionally utilized aliasing techniques to get around shortcomings in early versions of the Fortran language. Use the new -xalias flag to advise the compiler about how far the program deviates from the standard and what kind of aliasing syndromes it should expect. In some cases the compiler generates correct code only when the proper -xalias suboption is specified. Programs that conform strictly to the standard will find some performance improvement by advising the compiler to be unconcerned about aliasing. See Section , -xalias[=keywords], and the chapter on Porting in the Fortran Programming Guide.

Enhanced MODULE Features:

New flag -use=list forces one or more implicit USE statements into each subprogram. See Section , -use=list.

New flag -moddir=path controls where the compiler writes compiled MODULE subprograms (.mod files). See Section , -moddir=path. A new environment variable, MODDIR, also controls where .mod files are written.

The -Mpath flag will now accept directory paths, archive (.a) files, or module (.mod) files to search for MODULE subprograms. The compiler determines the type of the file by examining its contents; the actual file name extension is ignored. See Section , -Mpath.

When searching for modules, the compiler now looks first in the directory where module files are being written.

This release of the f95 compiler adds a number of new checks to the global program analysis provided by the -Xlist flag. The new -XlistMP suboption opens a new domain of static program analysis, verification of OpenMP parallelization directives. See Section , -Xlist[x], the Forte Developer OpenMP API User's Guide, and the chapter on Program Analysis and Debugging in the Fortran Programming Guide for details.

Identifying Known Libraries With -xknown_lib=library:

A new option, -xknown_lib=library, directs the compiler to treat references to certain known libraries as intrinsics, ignoring any user-supplied versions. This enables the compiler to perform optimizations over library calls based on its special knowledge of the library. In this release, the known library names are limited to blas, for a subset of the BLAS routines in the Sun Performance Library, and intrinsics, for ignoring explicit EXTERNAL declarations for Fortran 95 standard intrinsics and any user-supplied versions of these routines. See Section , -xknown_lib=library_list.

Ignoring Dummy Argument Type in Interfaces:

A new directive, !$PRAGMA IGNORE_TKR {list_of_variables}, causes the compiler to ignore the type, kind, and rank for the specified dummy argument names appearing in a generic procedure interface when resolving a specific call. Using this directive greatly simplifies writing generic interfaces for wrappers that call specific library routines based on argument type, kind, and rank. See Section 2.3.1.2, The IGNORE_TKR Directive for details.

Enhanced -C Runtime Array Checking:

In this f95 compiler release, runtime array subscript range checking with the -C option has been enhanced to include array conformance checking. A runtime error is produced when an array syntax statement is executed where the array sections are not conformable. See Section , -C.

Introducing Fortran 2000 Features:

Some new formatted I/O features proposed for the next Fortran standard have been implemented in this release of f95. These are the DECIMAL=, ROUND=, and IOMSG= specifiers, and they may appear in OPEN, READ, WRITE, PRINT, and INQUIRE statements. Also implemented are the DP, DC, RP, and RC edit descriptors. See Section 4.6.9, Fortran 2003 Formatted I/O Features for details.

Rounding in Formatted I/O:

A new option flag, -iorounding, sets the default rounding mode for formatted I/O. The modes, processor-defined or compatible, correspond to the ROUND= specifier implemented as part of the Fortran 2000 features. See Section , -iorounding[={compatible|processor-defined}].

Obsolete Flags Removed:

The following flags have been removed from the f95 command line:

-db-dbl

The following f77 compiler flags have not been implemented in the f95 compiler and are also considered obsolete:

Compiling with the new -xcheck=stkovf flag adds a runtime check for stack overflow conditions on entry to subprograms. If a stack overflow is detected, a SIGSEGV segment fault is raised. Stack overflows in multithreaded applications with large arrays allocated on the stack can cause silent data corruption in neighboring thread stacks. Compile all routines with -xcheck=stkovf if stack overflow is suspected. See Section , -xcheck=keyword.

New Default Thread Stack Size:

With this release, the default slave thread stack size has been increased to 4 Megabytes on SPARC V8 platforms, and 8 Megabytes on SPARC V9 platforms. See the discussion of stacks and stack sizes in the Parallelization chapter of the Fortran Programming Guide for details.

Enhanced Interprocedural Optimizations:

With -xipo=1 the compiler does inlining across all source files. This release adds -xipo=2 for enhanced interprocedural aliasing analysis and memory allocation and layout optimizations to imporve cache performance. See Section , -xipo[={0|1|2}].

Control Prefetch Instructions With -xprefetch_level=n:

Use the new flag -xprefetch_level=n to control the automatic insertion of prefetch instructions with -xprefetch=auto. Use requires an optimization level of -xO3 or greater and a target platform that supports prefetch (-xarch platforms v8plus, v8plusa, v8plusb, v9, v9a, v9b, generic64, or native64). See Section , -xprefetch_level={1|2|3}.

Feature histories for releases prior to Forte Developer 7 can be found in the documentation sets for those earlier releases on the http://docs.sun.com web site.