HP Fortran Programmer Guide HP-UX 11i v1, HP-UX 11i v2, and HP-UX 11i v3 (B3908-90032,December 2012)
Controlling vectorization locally.........................................................................................102
Calling BLAS library routines.............................................................................................103
Controlling code generation for performance...........................................................................104
7 Writing HP-UX applications......................................................................105
Accessing command-line arguments........................................................................................105
Calling HP-UX system and library routines................................................................................106
Using HP-UX file I/O.............................................................................................................106
Stream I/O using FSTREAM..............................................................................................106
Performing I/O using HP-UX system calls.............................................................................106
Establishing a connection to a file......................................................................................106
Obtaining an HP-UX file descriptor.....................................................................................107
8 Calling C routines from HP Fortran............................................................108
Data types...........................................................................................................................108
Unsigned integers............................................................................................................109
Logicals..........................................................................................................................109
Complex numbers............................................................................................................110
Derived types..................................................................................................................111
Pointers...........................................................................................................................111
Argument-passing conventions................................................................................................111
Case sensitivity.....................................................................................................................112
Arrays.................................................................................................................................114
Figure 3 Memory layout of a two-dimensional array in Fortran and C.....................................114
C strings..............................................................................................................................116
C null-terminated string.....................................................................................................116
Fortran hidden length argument.........................................................................................116
Passing a string...............................................................................................................116
File handling........................................................................................................................118
Sharing data........................................................................................................................120
9 Using Fortran directives...........................................................................121
Directive syntax....................................................................................................................121
Using HP Fortran directives....................................................................................................121
$HP$ ALIAS....................................................................................................................122
$HP$ CHECK_OVERFLOW...............................................................................................124
$HP$ LIST.......................................................................................................................125
$HP$ OPTIMIZE..............................................................................................................125
Compatibility directives.........................................................................................................126
Controlling vectorization...................................................................................................126
Controlling parallelization.................................................................................................127
Controlling dependence checks.........................................................................................127
Controlling checks for side effects.......................................................................................127
10 Migrating to HP Fortran.........................................................................129
Incompatibilities with HP FORTRAN 77...................................................................................129
Compiler limits................................................................................................................129
Command-line options not supported..................................................................................129
Format field widths...........................................................................................................130
Floating-point constants.....................................................................................................130
Intrinsic functions.............................................................................................................130
Procedure calls and definitions..........................................................................................131
Data types and constants..................................................................................................131
Input/output....................................................................................................................132
Directives........................................................................................................................132
Miscellaneous ................................................................................................................133
Migration issues...................................................................................................................133
Contents 5