FORTRAN Reference Manual
Mixed-Language Programming
FORTRAN Reference Manual—528615-001
13-5
Using Program Libraries
Data Areas in User Library Space
FORTRAN routines in user libraries cannot directly access data items declared in:
•
COMMON statements
•
DATA statements
•
SAVE statements
•
The extended data segment
Library routines can reference data in the preceding data areas only if the calling
routine passes the data item as an actual parameter to the library routine.
I/O Statements in User Library Space
Routines in library space can perform I/O operations but the units they access must be
defined in user code space. Units referenced by routines in FORTRAN libraries must
be defined in routines in user code space by one of the following:
•
A UNIT compiler directive, such as:
?UNIT 8
•
An executable I/O statement in user code space, not in user library space, that
specifies a constant unit number, such as:
OPEN(8, FN = 'FT008')
The expression you specify for a unit number in an I/O statement in library code space
must evaluate to a unit number defined in user code space. You must either pass the
unit number to the library routine as an actual parameter or establish a convention for
your application such that the library routine uses correct unit numbers.
Fault-Tolerant Statements in User Library Space
Routines in library space can execute START BACKUP and CHECKPOINT
statements.
However, unit numbers must be defined in a routine in user code space using the
same features as described in I/O Statements in User Library Space
on page 13-5.
Data items named in START BACKUP and CHECKPOINT statements must conform to
the rules stated in Data Areas in User Library Space on page 13-5.
Creating a User Library Space
To create a user library object file, use the same Binder commands—ADD, BUILD, and
so forth—described in Using Binder on page 13-4.










