Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Fortran v2.7 for HP-UX 11.0 and 11i Release Note > Chapter 1 HP Fortran v2.7 for HP-UX 11.0 and 11i Release Note

Previously-released Benefits

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

Previous releases of HP Fortran introduced these improvements:

Command-line flags

  • +multi_open—enables attaching multiple FORTRAN UNITs to the same file by allowing the file to be opened in multiple Fortran OPEN statements.

  • +io77—suppresses the generation of the optional leading "0" before the decimal point for real numbers printed with the E and F edit descriptors. FORTRAN 77 suppressed these leading zeros unless the NOSTANDARDIO flag was used. Along with +gformat77, the +io77 flag provides formatted output compatibility with the FORTRAN 77 product.

  • +cat—concatenates all source files of the same source form together, then compiles the concatenated source all at once. This enables inlining at +O3 within the concatenated file.

  • -dynamic—used to generate a dynamically-bound executable.

  • +[no]es—Similar to +[no]extend_source except that character literals and hollerith constants continued across a line boundary are not padded. This option provides compatibility with FORTRAN 77's +es option.

  • +getarg0

    +getarg1—these options control the behavior of the getarg intrinsic subroutine. +getarg0 requests the industry standard behavior for getarg, where an index value of zero causes the program name to be returned. HP's FORTRAN 77 getarg intrinsic also implements this industry standard convention. +getarg1 is used to request non-standard behavior, where an index value of one causes the program name to be returned (older releases of HP's Fortran behaved in this manner).

    The default is +getarg0.

  • gformat77—requests the FORTRAN 77 style of formatting a value of zero with the G edit descriptor. Fortran uses an F edit descriptor when the value being written is zero, while FORTRAN 77 uses an E edit descriptor.

  • +what—prints the what string for the Fortran driver, providing version and patch numbers.

  • +[no]signedzero—enables signed-zero support. This option forces a floating point value of negative zero that appears as a formatted output list item to be represented in the output record with a leading "-". This option also changes the behavior of the SIGN intrinsic.

    The default is +signedzero.

  • +es—similar to the existing +extend_source option, but differs in that it does not pad a character literal which spans a continuation line with blanks out to column 255. Instead, it behaves like FORTRAN 77's +es option, and only uses the actual blank characters in the continued line in the source file.

    +es only affects fixed source form blank padding.

    +noes disables this behavior (the default is +noes, meaning no extended lines, and character literals continued across lines are padded with blanks to column 72, the same as FORTRAN 77's behavior).

  • +fastallocatable—enables a different representation for allocatable arrays in the object code produced by the compiler. This alternate representation avoids problems in optimizing code containing allocatable array references. Additionally, this alternate representation for allocatable arrays is binary compatible with the old representation

  • +noalign64bitpointers—disables correct alignment of pointers in derived types when compiling for wide mode (+DA2.0W). Earlier releases of HP Fortran improperly aligned such pointers, occasionally leading to runtime aborts. Since this change introduces a potential binary incompatibility, the +noalign64bitpointers flag is provided to maintain the old behavior. Users who compile in wide mode (+DA2.0W)—and have derived types that contain components with the POINTER attribute—should recompile all source files that reference variables of that derived type. Users who have successfully used such derived type variables with older releases, and do not wish to recompile all affected source files, should always specify +noalign64bitpointers when compiling affected source files.

  • +Oopenmp—allows users to enable the OpenMP Directives. +Onoopenmp will disable the OpenMP Directives.

  • +r8—changes 4-byte real constants, intrinsics, and user variables to 8-byte reals (rather than the 4-byte default).

  • +i8—changes 4-byte integer and logical constants, intrinsics, and user variables to 8-byte integers (rather than the 4-byte default).

  • +sharedlibF90—allows users to link the shared version of libF90 or libF90_parallel from /usr/lib. This resolves potential issues with the F90 driver trying to link with the shared versions of libF90.

    In order to invoke +sharedlibF90, users must install one of the following three patches on both the machine used to link the executable and all machines intended to run the generated executable when using +sharedlibF90:

    • PHSS_25714: 11.00 shared libF90

    • PHSS_25716: 11i shared libF90

    • No patch is required for 11i.

    NOTE: Failure to install one of these patches will cause users to experience either a linker error if trying to link the executable, or a dynamic loader error if trying to run the executable.

GETARG

The GETARG intrinsic subroutine has been modified to be compatible with HP's FORTRAN 77 compiler and other vendors' implementations. This change requires source code changes and recompilation of all source files that call GETARG.

The first argument to GETARG, the index of the command line argument desired, is now zero based instead of one based. A value of one will now cause GETARG to return the first command line argument after the program name, instead of the program name, and a value of zero now returns the program name, instead of blanks.

Users wanting the old behavior can specify the following command line options:

+getarg1

Gather/scatter prefetch directive

The C$DIR PREFETCH array directive was previously added to the HP Fortran v2.3 compiler. This directive obtains prefetches for indirect array references. You are responsible for ensuring that the loop bounds are modified so that no out-of-bound array references are generated. A clean-up loop is typically required to account for references that cannot be prefetched.

The syntax of this directive is:
C$DIR PREFETCH list-of-array-references

Each array-reference must be syntactically and semantically acceptable as a left-hand side of an ASSIGNment statement. Any user array with elements identified in a PREFETCH directive does not automatically generate prefetching.

Below is an example of sample use of this directive:

C$DIR PREFETCH A(J(I+10))
DO I=1,N-10
A(J(I))=B(I)+C(I)
ENDDO
DO I=N-9,N
A(J(I))=B(I)+C(I)
ENDDO

In the above loop, automatic prefetching is still generated for the B, C, and J arrays. For the A array, A(J(I+10)) will be prefetched on the Ith iteration of the loop. Since J(I+10) may not be defined for I+10 greater than N, you will have to manually split off the last ten iterations of the loop.

Fortran 95 features

A new parallel DO statement and construct was added to HP Fortran. The form of this construct is:

FORALL forall-triplet-spec-list body-of statements
END FORALL

where: forall-triplet-spec-list is a list of the following:

index-name=subscript:subscript[:stride] followed by an optional scalar mask expression.

An example of a FORALL statement is shown below:

REAL :: A(10,10), B(10,10) = 1.0

FORALL (I-1: 10, J=1:10, B(1,J) /=0. 0)

A(I,J) = REAL(I+J-2) B(I,J) = A(I,J) +B(I,J)*REAL(I*J)

END FORALL

LibU77 routines provide Y2K compliance for HP-UX 11.0

Two libU77 subroutines—datey2k and idatey2k—are now available in the Fortran compiler to handle Year-2000 (Y2K) date-related issues on HP-UX 11.0. The +U77 flag must be issued with both subroutines. Although these are provided for Y2K compliance, it is recommended that the standard date_and_time intrinsic be used instead of these functions.

NOTE: The existing date and idate intrinsics do not have a Y2K problem. They only return the last two digits of the year. And they will continue to do so after the rollover. The behavior of these intrinsics cannot be modified because existing code may depend on the current behavior.

datey2k is designed to replace the f90 date intrinsic. Its function and arguments are the same as date's, except that the returned string contains a 4-digit year (mm-dd-yyyy) instead of a 2-digit year (mm-dd-yy).

The syntax of the datey2k subroutine is as follows:

subroutine datey2k(date)
character*11 date

idatey2k is designed to replace the HP Fortran idate intrinsic. idatey2k returns the true year in its third argument, as opposed to the idate intrinsic, which returns the number of years since 1900 in its third argument.

The syntax of the idatey2k subroutine is as follows:

subroutine idatey2k(month, date, year)
integer month, day, year

The libU77 routine idate has similar functionality to idatey2k (it returns the true year), but its arguments are passed differently.

  • In code where date is referenced, replace date with datey2k. Also, make sure that datey2k's argument is at least 11 characters in length.

  • In code where the idate intrinsic (not the libU77 idate routine) is used, replace idate with idatey2k.

Additional Improvements

  • Improved run time performance of Fortran features, particularly allocatable arrays. +fastallocatable and +noalign64bitpointers command-line flags are discussed below in "Command-line flags."

  • A native, subset OpenMP implementation—This new feature implements nine new directives, including PARALLEL, PARALLEL DO, PARALLEL SECTIONS, DO, SECTION, SECTIONS, BARRIER, CRITICAL, and ORDERED. More detailed information about this new feature is supplied in Appendix B of the HP-UX Parallel Programming Guide.

  • Improved optimization flag defaults.

  • wdb V2.0 support.

  • Improved compiler support—The compiler now supports the complete Fortran 95 standard.

  • DA1.1 Data Prefetching — This feature is beneficial if you want to run a single +Odataprefetch executable on both PA-RISC 1.1 and 2.0 architectures. Previously, if you built a +Odataprefetch executable on a 2.0 machine, the 1.1 architecture ignored it. The +DA1.1 +Odataprefetch flags allow programs to be built to run on both the PA-RISC 1.1 and 2.0 architectures but with the same benefits as 2.0 prefetching on 2.0 architectures. These flags cause DA2.0 prefetches to be inserted into the code in the same place they would be for +DA2.0 +Odataprefetch.

  • Sum Reduction Optimization — These have been optimized to compute several partial sums to more efficiently use PA-RISC 2.0 architecture, resulting in 2x runtime improvements. This optimization is only available at +O2 or higher optimization levels.

  • V2600 support — Support for V2600 server cache information has been added (HP-UX 11.0/11i only).

  • New Directive—The MIXED_FORMATS directive, which exists in HP FORTRAN 77, now works in HP Fortran v2.3 and above. This directive turns on or off mixed formats in formatted input/output (I/O) statements. It allows a numeric edit descriptor of a type different from that of the corresponding I/O list item to be read from or written to.

    The syntax of the MIXED_FORMATS directive is: $HP$MIXED_FORMATS [ON|OFF] where ON turns mixed formats on in formatted I/O statements, and OFF turns mixed formats off in formatted I/O statements.

  • Build-time improvements at optimization level +O3.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1979-2003 Hewlett-Packard Development Company, L.P.