HP Fortran Programmer's Reference (September 2007)

Program units and procedures
Arguments
Chapter 7 175
! intrinsic procedure passed as trig_func.
WRITE(6, 100) i,” degrees “, trig_func(i*pi/180)
END DO
100 FORMAT (I4, A9, F12.8)
END SUBROUTINE call_int_arg
Here are the command lines to compile and execute the program, along with the output from
a sample run:
$ f90 intrinsic_arg.f90
$ a.out
0 degrees 0.00000000
45 degrees 0.70710675
90 degrees 1.00000000
135 degrees 0.70710686
180 degrees 0.00000015
225 degrees -0.70710665
270 degrees -1.00000000
315 degrees -0.70710697
360 degrees -0.00000030
0 degrees 1.00000000
45 degrees 0.70710681
90 degrees 0.00000008
135 degrees -0.70710670
180 degrees -1.00000000
225 degrees -0.70710691
270 degrees -0.00000023
315 degrees 0.70710659
360 degrees 1.00000000
See Chapter 10, “HP Fortran Statements,” for information about the EXTERNAL and
INTRINSIC statements. Intrinsic procedures are fully described in Chapter 11, “Intrinsic
procedures,” on page 501.
Keyword option
The keyword option allows the programmer to specify actual arguments in a procedure
reference independently of the position of the dummy arguments. Using the keyword option,
the programmer explicitly pairs an actual argument with its dummy argument, as shown by
the syntax:
dummy-argument
=
actual-argument
If the keyword option is used for an argument, it must be followed by other arguments with
the keyword option. If all arguments in the argument list use the keyword option, the actual
arguments may appear in any order.