Purpose
Provides the ability to use
language features specific to the Fortran 2003 standard when compiling
with compiler invocations that conform to earlier Fortran standards,
as well as the ability to disable these features when compiling with
compiler invocations that conform to the Fortran 2003 standard.
Syntax
Option:
.-:-------------------.
| .-volatile--------. |
| +-stopexcept------+ |
| +-signdzerointr---+ |
| +-POLYmorphic-----+ |
| +-nooldnaninf-----+ |
| +-nodynamicacval--+ |
| +-bozlitargs------+ |
V +-autorealloc-----+ |
>>- -q--xlf2003--=----+-noautorealloc---+-+--------------------><
+-nobozlitargs----+
+-dynamicacval----+
+-oldnaninf-------+
+-NOPOLYmorphic---+
+-nosigndzerointr-+
+-nostopexcept----+
'-novolatile------'
@PROCESS:
@PROCESS XLF2003(suboption,suboption,...)
Defaults
The default suboption depends
on the invocation command that you specify.
The f2003, xlf2003,
or xlf2003_r command
has the following defaults:
autorealloc:bozlitargs:nodynamicacval:nooldnaninf:polymorphic:signdzerointr:
stopexcept:volatile
All
other invocation commands have the following defaults:
noautorealloc:nobozlitargs:nodynamicacval:oldnaninf:nopolymorphic:
nosigndzerointr:nostopexcept:novolatile
Parameters
- autorealloc | noautorealloc
- Controls
whether the compiler automatically reallocates the left-hand-side
(LHS) with the shape of the right-hand-side (RHS) when assigning into
an allocatable variable. If the LHS variable was not allocated
before the assignment, it is allocated automatically. The default
is autorealloc for the f2003, xlf2003,
and xlf2003_r commands,
and noautorealloc for all other commands. This suboption has
no effect on reallocation when the values of length type parameters
in the LHS and RHS differ.
- bozlitargs | nobozlitargs
- The bozlitargs suboption
ensures that the passing of boz-literal constants as arguments to
the INT, REAL, CMPLX, or DBLE intrinsic
function conforms to the Fortran 2003 standard.
The default is bozlitargs for the f2003, xlf2003,
and xlf2003_r
commands. The -qlanglvl=2003pure or -qlanglvl=2003std option
must be specified, as well. If -qport=typlssarg and -qxlf2003=bozlitargs are
specified, passing boz-literal constants to the CMPLX intrinsic
will yield non-standard results.
- dynamicacval | nodynamicacval
- When dynamicacval is in effect,
the dynamic types of array constructor values are used to determine
the type of the array constructors and you can use unlimited polymorphic
entities in array constructors. When nodynamicacval is
in effect, the declared types of array constructor values are used
to determine the type of the array constructors and you cannot use
unlimited polymorphic entities in array constructors.
Note: To make
the -qxlf2003=dynamicacval option effective,
you must also specify -qxlf2003=polymorphic.
- oldnaninf | nooldnaninf
- The oldnaninf suboption controls
the formatting of the output of IEEE NaN and infinity exceptional
values. This suboption has no effect on input. When oldnaninf is
in effect, the compiler uses the XL Fortran V10.1
(and earlier) behavior for output. That is, INF for infinity, NaNQ for a quiet NaN, and NANS for a signaling NaN.
When nooldnaninf is
in effect, the compiler output for IEEE exceptional values is compliant
with the Fortran 2003 standard.
That is, Inf for infinity, NaN(Q) for a quiet NaN, and NaN(S) for
a signaling NaN.
- polymorphic | nopolymorphic
- When polymorphic is in effect, the compiler
allows polymorphic items in Fortran source files. You can specify
the CLASS type specifier, the SELECT
TYPE construct, and use polymorphic items in other Fortran
statements. The use of the polymorphic argument also causes the compiler
to produce runtime type information for each derived type definition.
When nopolymorphic is
in effect, polymorphic items cannot be specified in Fortran source
files and no runtime type information is generated.
- signdzerointr |
nosigndzerointr
- When signdzerointr is in effect, the
passing of signed zeros to the SQRT, LOG, and ATAN2 intrinsic
functions returns results consistent with the Fortran 2003 standard.
The -qxlf90=signedzero option must be in effect, as well. For
the xlf, xlf_r, xlf_r7, f77, fort77, xlf90, xlf90_r, xlf90_r7,
and f90
invocations, specify both options to have the Fortran 2003 behavior.
The
following example shows the use of this suboption:
! If the Test program is compiled with -qxlf2003=signdzerointr
! and -qxlf90=signedzero, then Fortran 2003 behavior is seen.
! Otherwise, this program will demonstrate Fortran 95 behavior.
Program Test
real a, b
complex j, l
a = -0.0
j = sqrt(cmplx(-1.0,a))
b = atan2(a,-1.0)
l = log(cmplx(-1.0,a))
print *, 'j=', j
print *, 'b=', b
print *, 'l=', l
end
! Fortran 95 output:
j= (-0.0000000000E+00,1.000000000)
b= 3.141592741
l= (0.0000000000E+00,3.141592741)
! Fortran 2003 output:
j= (0.0000000000E+00,-1.000000000)
b= -3.141592741
l= (0.0000000000E+00,-3.141592741)
- stopexcept | nostopexcept
- When stopexcept is in effect, informational
messages are displayed when IEEE floating-point exceptions are signaled
by a STOP statement. Messages have the format:
STOP [stop-code]
(OVERFLOW, DIV-BY-ZERO, INVALID, UNDERFLOW, INEXACT)
where stop-code corresponds to the optional digit
string or character constant specified in the STOP statement. OVERFLOW, DIV-BY-ZERO, INVALID, UNDERFLOW and INEXACT appear
only if the corresponding flag is set. The following example shows
corresponding messages generated:
real :: rl1, rl2, rl3, rl4
logical :: l
rl1 = 1.3
rl2 = 0.0
rl3 = rl1 / rl2 ! divide by zero
rl4 = rl3 ! to make sure rl3 is actually used
rl4 = log(-rl1) ! invalid input for log
stop "The End"
end
Output:
STOP The End
(DIV-BY-ZERO, INVALID)
When nostopexcept is
in effect, informational messages are suppressed.
- volatile | novolatile
- When volatile is in effect, a non-VOLATILE
entity that is use- or host-associated can be specified as VOLATILE
in inner or local scope.
Usage
If the application uses F2003 polymorphism,
you must compile every unit with polymorphic specified.
If the application does not use polymorphism, specify the nopolymorphic suboption;
doing so may save compilation time and potentially improve runtime
performance.
Related information
See the following
information in XL Fortran Language Reference: