Intrinsic functions

HP Fortran supports most of the intrinsics that HP FORTRAN 77 ™offers, and more. In addition, most of these intrinsics are available in HP Fortran without having to activate them with compiler directives or command-line options (as with HP FORTRAN 77™).

With the larger number of available intrinsics in HP Fortran, there is the risk of name collisions with user-defined functions in existing HP FORTRAN 77™source code. Use of the

EXTERNALstatement can prevent such collisions. Also, many HP FORTRAN 77™ intrinsics accept additional (nonstandard) argument types; HP Fortran is more standard-conforming in this regard.

If the program you are migrating from HP FORTRAN 77™to HP Fortran calls libU77 routines in the BSD 3f library, the names of some of those routines may clash with names of HP Fortran intrinsics. Table on page 229 lists the names of libU77routines and intrinsic procedures that are

the same. If your HP FORTRAN 77™program calls any of these libU77routines, you should declare the routine with theEXTERNAL statement to get the libU77 routine; otherwise, the compiler will attempt to select the corresponding intrinsic procedure. (The f90option that links in the library of libU77 routines is +U77.

Table 40 Conflicting intrinsics and libU77 routine names

FREE

IARGC

MALLOC

 

 

 

GETARG

IDATE

SYSTEM

 

 

 

GETENV

LOC

TIME

 

 

 

See the HP Fortran Programmer's Reference for information about all of the HP Fortran intrinsics and the libU77 routines.

Command-line option issues

Command-line options can become a migration issue in two ways:

When you compile a program with the HP Fortran compiler, using an f77 command line. If the command line contains an unsupported f77 option, f90 will flag the option with an error message.

Table 10-5 lists the f77 and f90 that have the same functionality but different names. See Table on page 221 for a list of f77 options that are not supported by f90 and Table on page 221 for a list of f77 options that have been replaced by f90 options.

When you execute a program that consists of a mix of object files that have been created by f77 and f90. The problem here is that, although the object files may have been successfully linked, they may not be compatible. If they were incompatible, the resulting executable could behave unexpectedly or produce wrong results. Migration problems caused by incompatible object files are unusual but more difficult to detect and are discussed in the next section.

Table 41 f77 options supported by f90

f77 option

f90 option

function

 

 

 

-C

+check=all

Perform runtime subscript checking

 

 

 

-G

+gprof

Prepare for profiling with gprof

 

 

 

-K

+save

Use static storage for locals instead of stack

 

 

 

-N

+noshared

Mark linker output unshared

 

 

 

-n

+shared

Mark linker output shared

 

 

 

-p

+prof

Prepare for profiling with prof

 

 

 

Migration issues 137