HP Fortran Programmer's Reference (September 2007)

Introduction to HP Fortran
HP Fortran features
Chapter 1 37
Procedures
Fortran 90 includes a feature called the procedure interface block, which provides an
explicit interface for external procedures. The names and properties of the dummy
arguments are then available to the calling procedure, allowing the compiler to check that
the dummy and actual arguments match. For information about interface blocks, see
“Procedure interface” on page 181.
Actual arguments can be omitted from the argument list or can be arranged in a different
order from the dummy arguments.
You can implement user-defined operators or extend intrinsic operators, including the
assignment operator; see “Defined operators” on page 185 and “Defined assignment” on
page 187.
Dummy arguments to procedures can be given an INTENT attribute (IN, OUT or INOUT); see
“INTENT attribute” on page 178.
Subprograms can appear within a module subprogram, an external subprogram, or a
main program unit; see “Internal procedures” on page 167.
Recursive procedures (an extension in HP FORTRAN 77) are a standard feature of
Fortran 90. For more information, see “Recursive reference” on page 164.
Modules
A module is a program unit that can be used to specify data objects, named constants, derived
types, procedures, operators, and namelist groups. Partial or complete access to these module
entities is provided by the USE statement. An entity may be declared PRIVATE to limit
visibility to the module itself.
One use of the module is to provide controlled access to global data, making it a safer
alternative to the COMMON block. The module also provides a convenient way to encapsulate
the specification of derived types with their associated operations.
For information about modules, see “Modules” on page 190.
I/O features
Nonadvancing I/O
After a record-based I/O operation in FORTRAN 77, the file pointer moves to the start of
the next record. In Fortran 90, you can use the ADVANCE=NO specifier to position the file
pointer after the characters just read or written rather than at the start of the next
record. Nonadvancing I/O thus allows you to determine the length of a variable-length
record. See “Nonadvancing I/O” on page 216 for more information.