This section lists the new features and behavior changes specific to this 5.0 release of f90.
New options:
Most f77 options now recognized by f90.
-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 or v9a.
Support in the I/O library for large files (larger than 2 Gigabytes).
Support for large arrays on 64-bit Solaris 7 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:
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 with FORM='BINARY' has roughly the same effect as FORM='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 to BACKSPACE a FORM='BINARY' file, because there is no way of telling where to backspace to. A READ on a 'BINARY' file will read as much data as needed to fill the variables on the input list.
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 and DECODE 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 (or f77).
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 a USE statement. This means that all MODULE files must be compiled (and the module information files created) before compiling any file referencing a MODULE in a USE 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 attributes PURE and ELEMENTAL The enhanced forms of MAXVAL and MINVAL
New data types are recognized: COMPLEX*32 REAL*16 INTEGER*8 (also *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 with f90 programs compiled with the 1.2 compiler. A workaround would be to change the declarations to be INTEGER*4 or LOGICAL*4 instead of *1 or *2 when compiling with 2.0.
Call by value, %VAL, is implemented in the same manner as f77. The only difference is that f90 2.0 allows REAL*8 and REAL*16 to be passed to C routines as doubles and long doubles.
f77 and C Interoperability with f90 2.0:
To mix f77 and f90 object binaries, link with the f77 compatibility library, libf77compat, and not with libF77. For example, perform the link step with f90 ..files.. -lf77compat even if the main program is an f77 program.
The structure of f90 COMMON is now compatible with f77.
f90 scalar pointers are compatible with C pointers.