HP Fortran Programmer's Reference (September 2007)

HP Fortran statements
EXTERNAL (statement and attribute)
Chapter 10 359
The EXTERNAL attribute cannot be used with subroutines. To declare a subroutine as
EXTERNAL, use the statement form.
If the name is a dummy argument, an EXTERNAL statement declares it to be a dummy
procedure.
If a user-defined procedure or library routine has the same name as an intrinsic
procedure, then it must either be declared to have the EXTERNAL attribute or have an
explicit interface. The intrinsic procedure is then no longer available in such program
units.
The INTRINSIC and EXTERNAL attributes are mutually exclusive.
Examples
SUBROUTINE sub (fourier)
! fourier is a dummy procedure; actual argument corresponding to
! to fourier can be external, intrinsic, or module procedure
REAL fourier
EXTERNAL fourier ! statement form
REAL, EXTERNAL :: SIN, COS, TAN ! attribute form
! SIN, COS, and TAN are no longer intrinsic procedures; functions
! with these names must be defined in the program
...
END SUBROUTINE sub
SUBROUTINE gratx (x, y)
! Specify init_block_a as the block data
! subprogram that initializes common block a
EXTERNAL init_block_a
! Common block available in subroutine gratx
COMMON /a/ temp, pressure
END SUBROUTINE gratx
BLOCK DATA init_block_a
! init_block_a initializes the objects in common block a
COMMON /a/ temp, pressure
DATA temp, pressure/ 98.6, 15.5 /
END BLOCK DATA init_block_a
Related statements
INTRINSIC
Related concepts
For related information, see the following:
“Type declaration for intrinsic types” on page 109