XL Fortran for AIX 8.1

Language Reference

SOURCEFORM

Purpose

The SOURCEFORM compiler directive indicates that all subsequent lines are to be processed in the specified source form until the end of the file is reached or until an @PROCESS directive or another SOURCEFORM directive specifies a different source form.

Format



>>-SOURCEFORM--(--source--)------------------------------------><
 
 

source
is one of the following: FIXED, FIXED(right_margin), FREE(F90), FREE(IBM), or FREE. FREE defaults to FREE(F90).

right_margin
is an unsigned integer specifying the column position of the right margin. The default is 72. The maximum is 132.

Rules

The SOURCEFORM directive can appear anywhere within a file. An include file is compiled with the source form of the including file. If the SOURCEFORM directive appears in an include file, the source form reverts to that of the including file once processing of the include file is complete.

The SOURCEFORM directive cannot specify a label.

Tip

To modify your existing files to Fortran 90 free source form where include files exist:

  1. Convert your include files to Fortran 90 free source form: add a SOURCEFORM directive to the top of each include file. For example:
    !CONVERT* SOURCEFORM (FREE(F90))
    

    Define your own trigger_constant for this conversion process.

  2. Once all the include files are converted, convert the .f files. Add the same SOURCEFORM directive to the top of each file, or ensure that the .f file is compiled with -qfree=f90.
  3. Once all files have been converted, you can disable the processing of the directives with the -qnodirective compiler option. Ensure that -qfree=f90 is used at compile time. You may also delete any unnecessary SOURCEFORM directives.

Examples

@PROCESS DIRECTIVE(CONVERT*)
      PROGRAM MAIN          ! Main program not yet converted
      A=1; B=2
      INCLUDE 'freeform.f'
      PRINT *, RESULT       ! Reverts to fixed form
      END

where file freeform.f contains:

!CONVERT* SOURCEFORM(FREE(F90))
RESULT = A + B


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]