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.8.1 Form of Special f95 Directive Lines
4.8.2 FIXED and FREE Directives
4.8.3 Parallelization Directives
4.9.2 The -use=list Option Flag
5. FORTRAN 77 Compatibility: Migrating to Solaris Studio Fortran
The section describes extensions to Fortran 95 Input/Output handling that are accepted by the f95 compiler that are not part of the Fortran 2003 standard. Some are I/O extensions that appeared in the Fortran 77 compiler, f77, and are now part of the Fortran compiler.
Two new functions enable the user to specify their own error handling routine for formatted input on a logical unit. When a formatting error is detected, the runtime I/O library calls the specified user-supplied handler routine with data pointing at the character in the input line causing the error. The handler routine can supply a new character and allow the I/O operation to continue at the point where the error was detected using the new character; or take the default Fortran error handling.
The new routines, SET_IO_ERR_HANDLER(3f) and GET_IO_ERR_HANDLER(3f), are module subroutines and require USE SUN_IO_HANDLERS in the routine that calls them. See the man pages for these routines for details.
Fortran 77 allowed any integer constant in a format to be replaced by an arbitrary expression enclosed in angle brackets:
1 FORMAT( … < expr > … )
Variable format expressions cannot appear as the n in an nH… edit descriptor, in a FORMAT statement that is referenced by an ASSIGN statement, or in a FORMAT statement within a parallel region.
This feature is enabled natively in f95, and does not require the -f77 compatibility option flag.
The group name may be preceded by $ or & on input. The & is the only form accepted by the Fortran 95 standard, and is what is written by NAMELIST output.
Accepts $ as the symbol terminating input except if the last data item in the group is CHARACTER data, in which case the $ is treated as input data.
Allows NAMELIST input to start in the first column of a record.
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.
WRITE statement: Data is written to the file in binary, with as many bytes transferred as specified by the output list.
READ statement: Data is read into the variables on the input list, transferring as many bytes as required by the list. Because there are no record marks on the file, there will be no “end-of-record” error detection. The only errors detected are “end-of-file” or abnormal system errors.
INQUIRE statement: INQUIRE on a file opened with FORM=”BINARY” returns:
FORM=”BINARY”ACCESS=”SEQUENTIAL”DIRECT=”NO”FORMATTED=”NO”UNFORMATTED=”YES”RECL= AND NEXTREC= are undefined
BACKSPACE statement: Not allowed—returns an error.
ENDFILE statement: Truncates file at current position, as usual.
REWIND statement: Repositions file to beginning of data, as usual.
Recursive I/O possible on different units (this is because the f95 I/O library is "MT-Warm").
RECL=2147483646 (231-2) is the default record length on sequential formatted, list directed, and namelist output.
ENCODE and DECODE are recognized and implemented as described in the FORTRAN 77 Language Reference Manual.
Non-advancing I/O is enabled with ADVANCE=’NO’, as in:
write(*,’(a)’,ADVANCE=’NO’) ’n= ’ read(*,*) n