HP Fortran Programmer's Guide (September 2007)
Porting to HP Fortran
Using porting options
Chapter 11 243
• If the name of the source file ends with the .f90 extension, the file is compiled as free
form. The compiler accepts tab characters in the source.
• If the name of the source file ends with the .f or .F extension, the file is compiled as fixed
form.
• If the file is compiled with the +langlvl=90 option, the interprets the format as either
fixed or free form, depending on the filename extension (as described above). However, the
compiler issues warnings if it encounters tab characters.
• If the file is compiled with the +source=fixed option, the compiler assumes fixed form,
regardless of the extension. Tab characters are allowed.
• If the file is compiled with the +source=free option, the compiler assumes free form,
regardless of the extension.
• If the file is compiled with the +extend_source option, the compiler allows lines as long
as 254 characters in either fixed or free form. The default line length is 72 characters for
fixed form and 132 characters for free form.
See the HP Fortran Programmer’s Reference for detailed information about the different
source and the +langlvl=90, +source, and +extend_source options.
Escape sequences
Some implementation of Fortran process certain characters preceded by the backslash (\)asa
C-like escape sequence. For example, if a program containing the statement:
PRINT *, 'a\nb\nc'
were compiled under an implementation that recognized escape sequences, the statement
would output:
a
b
c
When compiled in strict compliance with the Standard, the same statement would output:
a\nb\nc
Although HP Fortran does not recognize escape sequences by default, you can use the
+escape option to make the compiler to recognize them. Refer to the
HP Fortran Programmer’s Reference for more information about escape sequences.