A fix is available
APAR status
Closed as program error.
Error description
Using a divide operation on an array as an argument to a function, the compiler is incorrectly outputting an error message: myvar = My_Class(1./val) ! ERROR HERE 1516-082 (S) Array object or expression is invalid in this context. The issue occurs when an array variable is specified as the denominator. If the array variable is specified as the numerator, the error does not occur. === TEST CASE === module my_module public :: My_Class type :: My_Class integer :: n real, allocatable :: ifc(:,:) end type My_Class interface My_Class module procedure my_constructor end interface contains function my_constructor(ifc) result(return) real, intent(in) :: ifc(:,:) type(My_Class) :: return end function my_constructor end module my_module program test_constructor use my_module type(My_Class) :: myvar real :: val(5,5) = 1. myvar = My_Class(1./val) ! ERROR HERE end program test_constructor $ xlf2003 test.F ** my_module === End of Compilation 1 === "test.F", line 28.18: 1516-082 (S) Array object or expression is invalid in this context. ** test_constructor === End of Compilation 2 === 1501-511 Compilation failed for file test.F. $
Local fix
Use a temporary array variable to do the division calculation, then pass the temporary to the function call.
Problem summary
PROBLEM DESCRIPTION: The compiler is not propagating the array information from the 2nd array operand to the whole expression. The compile then failed when checking the interface of the procedure reference. USERS AFFECTED: Users who pass an array operation expression where the array is the 2nd operand and the 1st operand is not an array, to a function that expects an array argument.
Problem conclusion
The issue was corrected.
Temporary fix
Comments
APAR Information
APAR number
LI78482
Reported component name
XL FORTRAN LINU
Reported component ID
5725C7500
Reported release
F10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2015-02-25
Closed date
2015-02-25
Last modified date
2015-02-25
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
XL FORTRAN LINU
Fixed component ID
5725C7500
Applicable component levels
RF10 PSN LI78098
UP06/09/13
[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSAT4T","label":"XL Fortran for Linux"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"15.1","Line of Business":{"code":"LOB57","label":"Power"}}]
Document Information
Modified date:
17 October 2021