HP Fortran Programmer's Guide (March 2010)
Porting to HP Fortran
Using porting options
Chapter 11 255
If this is compiled as coded and without the +langlvl=90 option, the compiler will assume
that the reference is to the HP intrinsic named INT1 and not to the external function.
Executing the program will produce unexpected results, as appears in the following sample
run:
$ f90 clash.f90
clash.f90
program CLASH
external function INT1
11 Lines Compiled
$ a.out
j = 4
If the program is recompiled with the +langlvl=90 option, the compiler flags the name of
what it assumes to be a nonstandard intrinsic as well as the nonstandard source format:
$ f90 +langlvl=90 clash.f90
program CLASH
i = 4
^
Warning 4 at (3:clash.f90) : Tab characters are an extension to
standard Fortran-90
j = int1(i)
^
Warning 39 at (5:clash.f90) : This intrinsic function is an
extension to standard Fortran-90
external function INT1
int1 = i+1
^
Warning 4 at (10:clash.f90) : Tab characters are an extension to
standard Fortran-90
11 Lines Compiled
Once you have identified the names of your routines that clash with intrinsic names, you can
edit the source code to declare each procedure with the EXTERNAL statement, as follows:
EXTERNAL int1
Now when you compile and execute, you will get the expected behavior:
$ f90 clash.f90
clash.f90
program CLASH
external function INT1
11 Lines Compiled
$ a.out
j = 5