Oracle® Solaris Studio 12.4: Fortran User's Guide

Exit Print View

Updated: March 2015
 
 

3.4.22 –f77[=list]

Select FORTRAN 77 compatibility mode.

This option flag enables porting legacy FORTRAN 77 source programs, including those with language extensions accepted by the Sun WorkShop f77 compiler, to the f95 Fortran compiler. (There is no longer a separate FORTRAN 77 compiler.)

list is a comma-separated list selected from the following possible keywords:

keyword
meaning
%all
Enable all the Fortran 77 compatibility features.
%none
Disable all the Fortran 77 compatibility features.
backslash
Accept backslash as an escape sequence in character strings.
input
Allow input formats accepted by f77.
intrinsics
Limit recognition of intrinsics to only Fortran 77 intrinsics.
logical
Accept Fortran 77 usage of logical variables, such as:
  • assigning integer values to logical variables

  • allowing arithmetic expressions in logical conditional statements, with .NE.0 representing .TRUE.

  • allowing relational operators .EQ. and .NE. with logical operands

misc
Allow miscellaneous f77 Fortran 77 extensions.
output
Generate f77-style formatted output, including list-directed and NAMELIST output.
subscript
Allow non-integer expressions as array subscripts.
tab
Enable f77-style TAB-formatting, including unlimited source line length. No blank padding will be added to source lines shorter than 72 characters.

All keywords can be prefixed by no% to disable the feature, as in:

-f77=%all,no%backslash

The default, when -f77 is not specified, is -f77=%none. Using -f77 without a list is equivalent to specifying -f77=%all.

Exceptions Trapping and -f77:

Specifying -f77 does not change the Fortran trapping mode, which is -ftrap=common. f95 differs from the Fortran 77 compiler’s behavior regarding arithmetic exception trapping. The Fortran 77 compiler allowed execution to continue after an arithmetic exception occurred. Compiling with -f77 also causes the program to call ieee_retrospective on program exit to report on any arithmetic exceptions that might have occurred. Specify -ftrap=%none following the -f77 option flag on the command line to mimic the original Fortran 77 behavior.

See Mixing Languages for complete information on f77 compatibility and Fortran 77 to Fortran 95 migration.

See also the -xalias flag for handling non-standard programming syndromes that may cause incorrect results.