HP Fortran Programmer's Reference (September 2007)

HP Fortran statements
CALL
Chapter 10292
4. Control returns from the subroutine, normally to the statement following the CALL
statement, or to a statement label indicated by an alternate return argument—*
label
or
&
label
. (The &
label
form is provided as a compatibility extension and can be used in
fixed source form only.)
A subroutine can call itself, directly or indirectly; in this case the keyword RECURSIVE must be
specified in the SUBROUTINE statement of the subroutine definition.
The %VAL and %REF built-in functions are provided as HP extensions. They can be used to
change argument-passing conventions calling a routine written in another language.
The only subroutine invocation other than by the CALL statement in Fortran 90 is through
“defined assignment”, where a defined type assignment operator that has been defined by
means of a subroutine is used.
Examples
! Interface for subroutine draw
INTERFACE
SUBROUTINE draw (x_start, y_start, x_end, y_end, form, scale)
REAL x_start, y_start, x_end, y_end
CHARACTER (LEN = 6), OPTIONAL :: form
REAL, OPTIONAL :: scale
END SUBROUTINE draw
END INTERFACE
! References to draw
! arguments given by position; optional argument scale omitted
CALL draw (5., -4., 2., .6, ”DASHED”)
! arguments given by keyword; optional argument form omitted
CALL draw (scale=.4, x_end=0., y_end=0., x_start=.5, y_start=.3)
Related statements
INTERFACE and SUBROUTINE
Related concepts
For related information, see the following:
“Recursive reference” on page 164
“Referencing a subroutine” on page 162
Arguments” on page 171
“%VAL and %REF built-in functions” on page 178
“Defined assignment” on page 187