Fortran User's Guide |
Features Release History
This Appendix lists the new and changed features in this and previous release of
f77
andf95
:Fortran 95 New Features and Changes
This section lists the new features and behavior changes specific to this Sun WorkShop 6 release of
f95
and previous releases.New Features in
f95
for Sun WorkShop 6:The following lists the new and changed features in the Fortran 95 compiler released with Sun Performance WorkShop 6:
- Compliance: The
f95
is fully compliant with the Fortran 95 standard.- New Command: The Fortran 95 compiler can be invoked by either the
f95
orf90
command.- Debugging Optimized Code: Restrictions limiting use of
-g
with other options has been relaxed, allowing debugging parallelized and-O4
or-O5
optimized codes with dbx and the Sun WorkShop debugger.- Source Filename Extensions: The compiler will accept source files with
.f95
and.f90
filename extensions as well as.F95
and.F90
.- Interval Arithmetic: This release implements a number of extensions that enable interval arithmetic computations. See the Interval Arithmetic Programming Reference, and
interval_arithmetic
README for details.- Enhanced Array Optimizations: The compiler now performs aggressive array optimizations at levels
-O4
and-O5
.- Hyper-Linked Diagnostic Messages: Sun WorkShop online help now interprets
f95
error diagnostics in the Building window, creating hypertext links from the error message to descriptive online help.- OpenMP: The compiler accepts OpenMP explicit parallelization directives. The OpenMP specifications can be viewed at
http://www.openmp.org/
AUTOSCOPE
added to Cray-styleDOALL
parallelization directive.- New/Changed Command-Line Options:
-aligncommon
aligns COMMON block elements to specific byte boundaries.-r8const
promotes single-precision data constants toREAL*8.
-xinterval
and-xia
enable interval arithmetic extensions.-xmemalign
specifies general alignment in memory of data elements.-mp=openmp
and-openmp
enable native compilation of OpenMP explicit parallelization directives.-xprefetch
(for enabling UltraSPARC prefetch instructions) has been expanded to include additional sub-options.-xrecursive
allows recursive calls from subprograms without theRECURSIVE
attribute.-xtypemap
has an expanded set of possible data type specifications.-fast
extended to set-O5
,-fsimple=2
,-xvector=yes
, and-pad=common
.- Use of
f95
's parallelization features requires a Sun WorkShop HPC license.New Features Released In
f90
2.0:The following new and changed features appeared in the
f90
2.0 compiler released with Sun WorkShop 5.0 over the earlierf90
1.2 release:
- New options:
- Most
f77
options now recognized byf90.
-fpover
detects floating-point overflows in I/O processing.-xcode=
code specifies the memory address model on SPARC platforms.-xcommonchk
enables runtime checking for inconsistent COMMON block declarations.-xprefetch
allows the compiler to generate prefetch instructions on UltraSPARC II platforms.-xvector
allows the compiler to replace certain math library calls within DO loops with single calls to a vectorized math routine.- Changed options:
-xcrossfile[=
n]
- optional level number added.-fns[={yes|no}]
- optional yes/no added.-Ztha
- option now ignored.- New Features:
- Compile for the 64-bit Solaris 7 environment on 64-bit SPARC platforms with
-xarch=v9
orv9a
.- Support in the I/O library for large files (larger than 2 Gigabytes).
- Support for large arrays on 64-bit Solaris operating environments.
- Accepts Sun-style directives by default.
- The
REDUCTION
directive accepts arrays in the list of variables.- SPARC: A
TASKCOMMON
directive declares variables in COMMON to be private.- New optimization pragma allows setting the compilers optimization level on a routine by routine basis.
- I/O Differences (Comparing
f90
2.0 against the 1.2 release):
- NAMELIST Output Format:
- 1.2: All variables in a single print statement written to a single line without line breaks. 2.0: Each variable printed to a separate line.
- 1.2: Comma used to separate values. 2.0: Single blank separates values.
- 1.2: Repeated values output using the r* form: 3*8.22 2.0: All repeated values output explicitly: 8.22 8.22 8.22
- 1.2: No trailing zero printing integer floating point: 1. 2.0: Floating point integers print with trailing zero: 1.0
- 1.2: Value printed may not be the same value when read into a variable with the same type: 0.1 when read in will print as 0.100000001 2.0: Prints the minimum number of digits required to ensure that a value written produces the same value when read back in: 0.1 prints as 0.1
- 1.2: As required by the standard, zero value prints in exponent form. But 1.2 prints 0.E+0 2.0: Prints zero as 0.0E+0
- 1.2: Prints a space between the comma and the imaginary part of a complex value: (1., 0.E+0) 2.0: No comma: (1.0,0.0E+0)
- NAMELIST Input Format:
- 2.0: Allow the group name to be preceded by
$
or&
on input. The&
is the only form accepted by the Fortran 90 standard, and is what is written by NAMELIST output.- 2.0: Accepts
$
as the symbol terminating input except if the last data item in the group is CHARACTER, in which case it is treated as input data.- 2.0: Allows NAMELIST input to start in the first column of a record.
PRINT *
no longer comma-delimits output.OPEN FORM='BINARY'
permits I/O of non-standard raw text without record marks: Opening a file withFORM='BINARY'
has roughly the same effect asFORM='UNFORMATTED'
, except that no record lengths are embedded in the file. Without this data, there is no way to tell where one record begins, or ends. Thus, it is impossible toBACKSPACE
aFORM='BINARY'
file, because there is no way of telling where to backspace to. AREAD
on a'BINARY'
file will read as much data as needed to fill the variables on the input list. See Appendix C or the Fortran 77 Language Reference for details.- Recursive I/O possible on different units (this is because the
f90
I/O library is "MT-Warm").- RECL=2147483646 (231-2) is the default record length on sequential formatted, list directed, and namelist output. (Default was 267).
ENCODE
andDECODE
are recognized and implemented as described in the FORTRAN 77 Language Reference Manual.- Naming of scratch files is the same as with
f77
.- Non-advancing I/O is enabled with
ADVANCE='NO'
, as in:
write(*,'(a)',ADVANCE='NO') 'n= '
read(*,*) n
- Handling of I/O on internal files follows the Fortran 90 standard more closely than was the case with
f90
1.2. Also, calls to routines that do internal I/O are allowed on I/O lists. This was not allowed with 1.2 (orf77
).- Operational Differences:
- Modules are handled differently: Compiling a source code that contains one or more
MODULE
units now causes an information file ( name.mod ) to be generated for each module. The name of this information file is the name of the module, in lower case, with.mod
suffix. A.mod
file must be available before the module can appear on aUSE
statement. This means that allMODULE
files must be compiled (and the module information files created) before compiling any file referencing aMODULE
in aUSE
statement-ftrap=common
is the default trapping mode.- Routines from the Sun Performance Library are automatically linked to perform array operations.
- New Language Elements:
- Some Fortran 95 elements are implemented:
The attributesPURE
andELEMENTAL
The enhanced forms ofMAXVAL
andMINVAL
- New data types are recognized:
COMPLEX*32 REAL*16
(also
INTEGER*8*1
,*2
)LOGICAL*8
(also*1
,*2
)- Some data representations have changed from
f90
1.2:
INTEGER*2
is now 2 bytes, not 4
INTEGER*1
is now 1 byte, not 4
LOGICAL*2
is now 2 bytes, not 4
LOGICAL*1
is now 1 byte, not 4
This will affect programs that read binary data files containing these data items that were written withf90
programs compiled with the 1.2 compiler. A workaround would be to change the declarations to beINTEGER*4
orLOGICAL*4
instead of*1
or*2
when compiling with 2.0.- Call by value,
%VAL
, is implemented in the same manner asf77
. The only difference is thatf90
2.0 allowsREAL*8
andREAL*16
to be passed to C routines as doubles and long doubles.f77
and C Interoperability withf90
2.0:
- To mix
f77
andf90
object binaries, link with thef77
compatibility library,libf77compat
, and not withlibF77
. For example, perform the link step withf90
..files..-lf77compat
even if the main program is anf77
program.- The structure of
f90
COMMON is now compatible withf77
.f90
scalar pointers are compatible with C pointers.Fortran 77 New Features and Changes
This section lists the new features and behavior changes specific to
f77
in this and previous releases.New Features in
f77
for Sun WorkShop 6:Sun WorkShop 6 Fortran 77 includes the following new and changed features:
- I/O Extension: Opening a file with
OPEN(FORM='BINARY')
treats the file as a sequential binary (unformatted) file with no record marks. See the Fortran 77 Language Reference for details.- Debugging Optimized Code: Restrictions limiting use of
-g
with other options has been relaxed, allowing debugging parallelized and-O4
or-O5
optimized codes with dbx and the Sun WorkShop debugger.- New/Changed Command-Line Options:
-aligncommon
aligns COMMON block elements to specific byte boundaries.-r8const
promotes single-precision data constants to REAL*8-xmemalign
specifies general alignment in memory of data elements.-xprefetch
(for enabling UltraSPARC prefetch instructions) has been expanded to include additional sub-options.-xtypemap
has an expanded set of possible data type specifications.-fast
extended to set-O5
,-fsimple=2
,-xvector=yes
, and-pad=common
.- Use of
f77
's parallelization features requires a Sun WorkShop HPC license.- Hyper-Linked Diagnostic Messages: Sun WorkShop online help now interprets
f77
error diagnostics in the Building window, creating hypertext links from the error message to descriptive online help.Features in
f77
5.0:
f77
5.0 included the following new and changed features:
- New options:
-fpover
detects floating-point overflows in I/O processing.-xcode=
code specifies the memory address model on SPARC platforms.-xcommonchk
enables runtime checking for inconsistent COMMON block declarations.
-xmaxopt
enables theOPT=
n pragma and controls the maximum optimization level allowed byOPT
pragmas in the source code.
-xprefetch
allows the compiler to generate prefetch instructions on UltraSPARC II platforms.
-xvector
allows the compiler to replace certain math library calls within DO loops with single calls to a vectorized math routine.- Changed options:
-xcrossfile[=
n]
- optional level number added.-fns[={yes|no}]
- optional yes/no added.-Ztha
- option now ignored.- New Features:
- Compile for the 64-bit Solaris 7 environment on 64-bit SPARC platforms with
-xarch=v9
orv9a
.- Support in the I/O library for large files (larger than 2 Gigabytes).
- Support for large arrays on 64-bit Solaris 7 environments.
- Dynamic arrays (local arrays with dynamic size) implemented (see FORTRAN 77 Language Reference Manual).
- The
REDUCTION
directive accepts arrays in the list of variables.- SPARC: A
TASKCOMMON
directive declares variables in COMMON to be private.- Fortran 90 style constants that allows specification of byte size (for example, 12345678_8 for a 64-bit, 8-byte, constant).
- New optimization pragma allows setting the compilers optimization level on a routine by routine basis.
- Year 2000 safe
date_and_time()
library routine.Features in
f77
4.2:
f77
4.2 included the following features that were new or changed since the 4.0 release:n
- New options:
-xpp=fpp|cpp
- Changed options:
- Options
-fround, -fsimple, -ftrap, -xprofile=tcov,
now available on Intel platforms.
-xspace, -xunroll-xtarget, -xarch, -xchip
expanded for SPARC Ultra and Intel platforms.
-vax=
expanded to enable selection/deselection of individual VAX/VMS Fortran features.
- Default sourcefile preprocessor is fpp(1) rather than cpp(1).
FORTRAN 77 Upward Compatibility
The FORTRAN 77 5.0 source is compatible with earlier releases, except for minor changes due to operating system changes and bug fixes.
Fortran 3.0/3.0.1 to 4.0
Executables (
a.out
), libraries (.a
), and object files (.o
) compiled and linked in Fortran 3.0/3.0.1 under Solaris 2 are compatible with Fortran 5.0 under Solaris 2.BCP: Running Applications from Solaris 1
You must install the Binary Compatibility Package for the executable to run.
Executables compiled and linked in Solaris 1 do run in Solaris 2, but they do not run as fast as when they are compiled and linked under the appropriate Solaris release.
Libraries (
.a
) and object files (.o
) compiled and linked in Fortran 2.0.1 under Solaris 1 are not compatible with Fortran 5.0.
Sun Microsystems, Inc. Copyright information. All rights reserved. Feedback |
Library | Contents | Previous | Next | Index |