LF Fortran 95

Runtime Options

The behavior of the LF95 runtime library can be modified at the time of execution by a set of commands which are submitted via the command line when invoking the executable program, or via environment variables. These runtime options can modify behavior of input/output operations, diagnostic reporting, and floating-point operations.

Runtime options submitted on the command line are returned by the GETCL, GETPARM, and GETARG functions.

Command Format

Runtime options and user-defined executable program options may be specified as command option arguments of an execution command. The runtime options use functions supported by the LF95 runtime library. Please note that these options are case-sensitive.

The format of runtime options is as follows:

exe_file [ /Wl,[runtime options] ,...] [ user-defined program arguments] ...

Where exe_file indicates the user's executable program file. The string "/Wl," (or "-Wl,") must precede any runtime options, so they may be identified as such and distinguished from user-defined program arguments. Note that it is W followed by a lowercase L (not the number one). Please note also that if an option is specified more than once with different arguments, the last occurrence is used.

Command environment Variable

As an alternative to the command line, the environment variable FORT90L may be used to specify runtime options. Any runtime options specified in the command line are combined with those specified in FORT90L. The command line arguments take precedence over the corresponding options specified in the environment variable FORT90L.

The following examples show how to use the environment variable FORT90L (the actual meaning of each runtime option will be described in the sections below):

Example 1:

Setting the value of environment variable FORT90L and executing the program as such:

set FORT90L=-Wl,e99,le a.exe -Wl,m99 /k

has the same effect as the command line

a.exe -Wl,e99,le,m99 /k

The result is that when executing the program a.exe, the runtime options e99, le, and m99, and user-defined executable program argument /k are in effect.

Example 2:

When the following command lines are used,

set FORT90L=-Wl,e10 a.exe -Wl,e99

the result is that a.exe is executed with runtime option /e99 is in effect, overriding the option e10 set by environment variable FORT90L.

Execution Return Values

The following table lists possible values returned to the operating system by an LF95 executable program upon termination and exit. These correspond to the levels of diagnostic output that may be set by various runtime options:

Execution Return Values

Return value

Status

0

No error or level I (information message)

4

Level W error (warning)

8

Level E error (medium)

12

Level S error (serious)

16

Limit exceeded for level W, E, S error, or a level U error (Unrecoverable) was detected

240

Abnormal termination

Other

Forcible termination

Standard Input and Output

The default unit numbers for standard input, output, and error output for LF95 executable programs are as follows, and may be changed to different unit numbers by the appropriate runtime options:

  • Standard input: Unit number 5
  • Standard output: Unit number 6
  • Standard error output: Unit number 0
  • Runtime Options

    Runtime options may be specified as arguments on the command line, or in the FORT90L environment variable. This section explains the format and functions of the runtime options. Please note that all runtime options are case-sensitive.

    The runtime option format is as follows:

    /Wl [,Cunit] [,M] [,Q] [,Re] [,Rm:file] [,Tunit] [,a] [,dnum] [,enum] [,gnum] [,i] [,lelvl] [,munit] [,n][,punit] [,q] [,runit] [,u] [,x]

    When runtime options are specified, the string "/Wl" (where l is lowercase L) is required at the beginning of the options list, and the options must be separated by commas. If the same runtime option is specified more than once with different arguments, the last occurrence is used.

    Example:

    a.exe /Wl,a,p10,x

    Description of Options

    C or C[unit]

    The C option specifies how to process an unformatted file of IBM370-format floating-point data using an unformatted input/output statement. When the C option is specified, the data of an unformatted file associated with the specified unit number is regarded as IBM370-format floating-point data in an unformatted input/output statement. The optional argument unit specifies an integer from 0 to 2147483647 as the unit number. If optional argument unit is omitted, the C option is valid for all unit numbers connected to unformatted files. When the specified unit number is connected to a formatted file, the option is ignored for the file. When the C option is not specified, the data of an unformatted file associated with unit number unit is regarded as IEEE-format floating-point data in an unformatted input-output statement.

    Example:

    a.exe /Wl,C10

    M

    The M option specifies whether to output the diagnostic message (jwe0147i-w) when bits of the mantissa are lost during conversion of IBM370-IEEE-format floating-point data. If the M option is specified, a diagnostic message is output if conversion of IBM370-IEEE-format floating-point data results in bits of the mantissa being lost. When the M option is omitted, the diagnostic message (jwe0147i-w) is not output.

    Example:

    a.exe /Wl,M

    Q

    The Q option suppresses padding of an input field with blanks when a formatted input statement is used to read a Fortran record. This option applies to cases where the field width needed in a formatted input statement is longer than the length of the Fortran record and the file was not opened with and OPEN statement. The result is the same as if the PAD= specifier in an OPEN statement is set to NO. If the Q option is omitted, the input record is padded with blanks. The result is the same as when the PAD= specifier in an OPEN statement is set to YES or when the PAD= specifier is omitted.

    Example:

    a.exe /Wl,Q

    Re

    Disables the runtime error handler. Traceback, error summaries, user control of errors by ERRSET and ERRSAV, and execution of user code for error correction are suppressed. The standard correction is processed if an error occurs.

    Example:

    a.exe /Wl,Re

    Rm: filename

    The Rm option saves the following output items to the file specified by the filename argument:

  • Messages issued by PAUSE or STOP statements
  • Runtime library diagnostic messages
  • Traceback map
  • Error summary
  • Example:

    a.exe /Wl,Rm:errors.txt

    Ry

    Enforces Y2K compliance at runtime by generating an i-level (information) diagnostic whenever code is encountered which may cause problems after the year 2000A.D. Must be used in conjunction with li option in order to view diagnostic output.

    Example:

    a.exe /Wl,Ry,li

    T or T[u_no]

    Big endian integer data, logical data, and IEEE floating-point data is transferred in an unformatted input/output statement. The optional argument u_no is a unit number, valued between 0 and 2147483647, connected with an unformatted file. If u_no is omitted, T takes effect for all unit numbers. If both T and Tu_no are specified, then T takes effect for all unit numbers.

    Example:

    a.exe /Wl,T10

    a

    When the a option is specified, an abend is executed forcibly following normal program termination. This processing is executed immediately before closing external files.

    Example:

    a.exe /Wl,a

    d[num] 1

    The d option determines the size of the input/output work area used by a direct access input/output statement. The d option improves input/output performance when data is read from or written to files a record at a time in sequential record-number order. If the d option is specified, the input/output work area size is used for all units used during execution.

    To specify the size of the input/output work area for individual units, specify the number of Fortran records in the environment variable FUnnBF where nn is the unit number (see Environment Variables for Input/Output for details). When the d option and environment variable are specified at the same time, the d option takes precedence. The optional argument num specifies the number of Fortran records, in fixed-block format, included in one block. The optional argument num must be an integer from 1 to 32767. To obtain the input/output work area size, multiply num by the value specified in the RECL= specifier of the OPEN statement. If the files are shared by several processes, the number of Fortran records per block must be 1. If the d option is omitted, the size of the input/output work area is 4K bytes.

    Example:

    a.exe /Wl,d10

    e[num]

    The e option controls termination based on the total number of execution errors. The option argument num, specifies the error limit as an integer from 0 to 32767. When num is greater than or equal to 1, execution terminates when the total number of errors reaches the limit. If enum is omitted or num is zero, execution is not terminated based on the error limit. However, program execution still terminates if the Fortran system error limit is reached.

    Example:

    a.exe /Wl,e10

    gnum

    The g option sets the size of the input/output work area used by a sequential access input/output statement. This size is set in units of kilobytes for all unit numbers used during execution. The argument num specifies an integer with a value of 1 or more. If the g option is omitted, the size of the input/output work area defaults to 8 kilobytes.

    The g option improves input/output performance when a large amount of data is read from or written to files by an unformatted sequential access input/output statement. The argument num is used as the size of the input/output work area for all units. To avoid using excessive memory, specify the size of the input/output work area for individual units by specifying the size in the environment variable fuxxbf, where xx is the unit number (see Environment Variables for Input/Output for details). When the g option is specified at the same time as the environment variable fuxxbf, the g option has precedence.

    Example:

    a.exe /Wl,g10

    i

    The i option controls processing of runtime interrupts. When the i option is specified, the Fortran library is not used to process interrupts. When the i option is not specified, the Fortran library is used to process interrupts. These interrupts are exponent overflow, exponent underflow, division check, and integer overflow. If runtime option -i is specified, no exception handling is taken. The u option must not be combined with the i option

    Example:

    a.exe /Wl,i

    lerrlvl errlvl: { i | w | e | s }

    The l option (lowercase L) controls the output of diagnostic messages during execution. The optional argument errlvl, specifies the lowest error level, i (informational), w (warning), e (medium), or s (serious), for which diagnostic messages are to be output. If the l option is not specified, diagnostic messages are output for error levels w, e, and s. However, messages beyond the print limit are not printed.

    i

    The li option outputs diagnostic messages for all error levels.

    w

    The lw option outputs diagnostic messages for error levels w, e, s, and u.

    e

    The le option outputs diagnostic messages for error levels e, s, and u.

    s

    The ls option outputs diagnostic messages for error levels s and u.

    Example:

    a.exe /Wl,le

    mu_no

    The m option connects the specified unit number u_no to the standard error output file where diagnostic messages are to be written. Argument u_no is an integer from 0 to 2147483647. If the m option is omitted, unit number 0, the system default, is connected to the standard error output file. See Environment Variables for Input/Output for further details.

    Example:

    a.exe /Wl,m10

    n

    The n option controls whether prompt messages are sent to standard input. When the n option is specified, prompt messages are output when data is to be entered from standard input using formatted sequential READ statements, including list-directed and namelist statements. If the n option is omitted, prompt messages are not generated when data is to be entered from standard input using a formatted sequential READ statement.

    Example:

    a.exe /Wl,n

    pu_no

    The p option connects the unit number u_no to the standard output file, where u_no is an integer ranging from 0 to 2147483647. If the p option is omitted, unit number 6, the system default, is connected to the standard output file. See Environment Variables for Input/Output for further details.

    Example:

    a.exe /Wl,p10

    q

    The q option specifies whether to capitalize the E, EN, ES, D, Q, G, L, and Z edit output characters produced by formatted output statements. This option also specifies whether to capitalize the alphabetic characters in the character constants used by the inquiry specifier (excluding the NAME specifier) in the INQUIRE statement. If the q option is specified, the characters appear in uppercase letters. If the q option is omitted, the characters appear in lowercase letters. If compiler option -nfix is in effect, the characters appear in uppercase letters so the q option is not required.

    Example:

    a.exe /Wl,q

    ru_no

    The r option connects the unit number u_no to the standard input file during execution, where u_no is an integer ranging from 0 to 2147483647. If the r option is omitted, unit number 5, the system default, is connected to the standard input file. See Environment Variables for Input/Output for further details.

    Example:

    a.exe /Wl,r10

    u

    The u option controls floating point underflow interrupt processing. If the u option is specified, the system performs floating point underflow interrupt processing. The system may output diagnostic message jwe0012i-e during execution. If the u option is omitted, the system ignores floating point underflow interrupts and continues processing. The i option must not be combined with the u option.

    Example:

    a.exe /Wl,u

    x

    The x option determines whether blanks in numeric edited input data are ignored or treated as zeros. If the x option is specified, blanks are changed to zeros during numeric editing with formatted sequential input statements for which no OPEN statement has been executed. The result is the same as when the BLANK= specifier in an OPEN statement is set to zero. If the x option is omitted, blanks in the input field are treated as null and ignored. The result is the same as if the BLANK= specifier in an OPEN statement is set to NULL or if the BLANK= specifier is omitted.

    Example:

    a.exe /Wl,x

    Environment Variables for Input/Output

    This section describes environment variables that control file input/output operations

    FUnn = filname

    The FUnn environment variable connects units and files. The value nn is a unit number. The value filename is a file to be connected to unit number nn. The standard input and output files (FU05 and FU06) and error file (FU00) must not be specified.

    The following example shows how to connect myfile.dat to unit number 10 prior to the start of execution.

    Example:

    set FU10=myfile.dat

    FUnnBF = size

    The FUnnBF environment variable specifies the size of the input/output work area used by a sequential or direct access input/output statement. The value nn in the FUnnBF environment variable specifies the unit number. The size argument used for sequential access input/output statements is in kilobytes; the size argument used for direct access input/output statements is in records. The size argument must be an integer with a value of 1 or more. A size argument must be specified for every unit number.

    If this environment variable and the g option are omitted, the input/output work area size used by sequential access input/output statements defaults to 1 kilobytes. The size argument for direct access input/output statements is the number of Fortran records per block in fixed-block format. The size argument must be an integer from 1 to 32767 that indicates the number of Fortran records per block. If this environment variable and the d option are omitted, the area size is 1K bytes.

    Example 1:

    Sequential Access Input/Output Statements.

    When sequential access input/output statements are executed for unit number 10, the statements use an input/output work area of 64 kilobytes.

    set FU10BF=64

    Example 2:

    Direct Access Input/Output Statements.

    When direct access input/output statements are executed for unit number 10, the number of Fortran records included in one block is 50. The input/output work area size is obtained by multiplying 50 by the value specified in the RECL= specifier of the OPEN statement.

    set FU10BF=50