IBM Support

IV68024: ERROR PASSING ARRAY ARGUMENT WITH DIVISION

Subscribe

You can track all active APARs for this component.

 

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

    IV68024

  • Reported component name

    XL FORTRAN FOR

  • Reported component ID

    5725C7400

  • Reported release

    F10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2014-12-17

  • Closed date

    2014-12-17

  • Last modified date

    2014-12-17

  • APAR is sysrouted FROM one or more of the following:

    LI78098

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    XL FORTRAN FOR

  • Fixed component ID

    5725C7400

Applicable component levels

  • RF10 PSY

       

[{"Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSGH4D","label":"XL Fortran for AIX"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"15.1"}]

Document Information

Modified date:
03 October 2021