-qport

Category

Portability and migration

Purpose

Provides options to accommodate other Fortran language extensions when porting programs to XL Fortran.

A particular -qport suboption will always function independently of other -qport and compiler options.

Syntax

Read syntax diagramSkip visual syntax diagram
        .-noport-------------------------------.   
>>- -q--+-port--+----------------------------+-+---------------><
                |    .-:-------------------. |     
                |    |   .-notyplssarg-.   | |     
                |    |   +-notypestmt--+   | |     
                |    |   +-nosce-------+   | |     
                |    |   +-nonullarg---+   | |     
                |    |   +-nomod-------+   | |     
                |    |   +-nohexint----+   | |     
                |    V   +-noclogicals-+   | |     
                '-=------+-clogicals---+---+-'     
                         +-hexint------+           
                         +-mod---------+           
                         +-nullarg-----+           
                         +-sce---------+           
                         +-typestmt----+           
                         '-typlssarg---'           

@PROCESS:

@PROCESS PORT[(suboptions)]| NOPORT

Defaults

-qnoport

Parameters

clogicals | noclogicals
When clogicals is in effect, the compiler treats all non-zero integers that are used in logical expressions as TRUE. You must specify -qintlog for -qport=clogicals to take effect.

The -qport=clogicals option is useful when porting applications from other Fortran compilers that expect this behavior. However, it is unsafe to mix programs that use different settings for non-zero integers if they share or pass logical data between them. Data files already written with the default -qintlog setting will produce unexpected behavior if read with the -qport=clogicals option active.

hexint | nohexint
When hexint is in effect, typeless constant hexadecimal strings are converted to integers when passed as an actual argument to the INT intrinsic function. Typeless constant hexadecimal strings not passed as actual arguments to INT remain unaffected.
mod | nomod
Specifying mod relaxes existing constraints on the MOD intrinsic function, allowing two arguments of the same data type to be of different kind type parameters. The result will be of the same type as the argument, but with the larger kind type parameter value.
nullarg | nonullarg
For an external or internal procedure reference, specifying nullarg causes the compiler to treat an empty argument, which is delimited by a left parenthesis and a comma, two commas, or a comma and a right parenthesis, as a null argument. This suboption has no effect if the argument list is empty.
Examples of empty arguments are:
call foo(,,z)

call foo(x,,z)

call foo(x,y,)
The following program includes a null argument.

Fortran program:

program nularg
real(4) res/0.0/
integer(4) rc
integer(4), external :: add
rc = add(%val(2), res, 3.14, 2.18,) ! The last argument is a
                                    ! null argument.
if (rc == 0) then
print *, "res = ", res
else
print *, "number of arguments is invalid."
endif
end program

C program:

int add(int a, float *res, float *b, float *c, float *d)
{
   int ret = 0;
   if (a == 2)
     *res = *b + *c;
   else if (a == 3)
     *res = (*b + *c + *d);
   else
     ret = 1;
   return (ret);
}
sce | nosce
By default, the compiler performs short circuit evaluation in selected logical expressions using XL Fortran rules. Specifying sce allows the compiler to use non-XL Fortran rules. The compiler will perform short circuit evaluation if the current rules allow it.
typestmt | notypestmt
The TYPE statement, which behaves in a manner similar to the PRINT statement, is supported whenever typestmt is specified.
typlssarg | notyplssarg
Converts all typeless constants to default integers if the constants are actual arguments to an intrinsic procedure whose associated dummy arguments are of integer type. Typeless actual arguments associated with dummy arguments of noninteger type remain unaffected by this option.

Using this option may cause some intrinsic procedures to become mismatched in kinds. Specify -qxlf77=intarg to convert the kind to that of the longest argument.

Related information