HP Fortran Programmer's Guide (B3908-90031; September 2011)

Porting to HP Fortran
Using porting options
Chapter 11 247
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
NOTE The name-conflict problem can occur in Fortran programs that call routines in the
libU77.a library. Some implementations link libU77.a by default. HP Fortran does not;
to link in this library, you must compile your program with the +U77 option. If you do not
compile with this option and your program references a libU77 routine with the same
name as an HP Fortran intrinsic, the compiler will wrongly (and sometimes disastrously)
assume that the reference is to an intrinsic.