C/C++ and Fortran

 View Only

Scalar as the actual argument corresponding to an assumed-size dummy argument of assumed-type

By Archive User posted Mon November 03, 2014 04:18 AM

  

Originally posted by: ChristineLi


To facilitate function calls, a constraint has been relaxed according to TS29113, starting from XL Fortran for AIX Fix Pack 1 (September 2014 PTF) for 15.1 and
XL Fortran for Linux Fix Pack 1 (October 2014 PTFs) for 15.1. Now you can pass a scalar as the actual argument that corresponds to an assumed-size dummy argument of assumed-type. In this case, the assumed-size array dummy argument has exactly one element.

Here is a code example for your reference:

REAL r1
CALL sub(r1)
!You can pass a scalar as the actual argument that corresponds
!to an assumed-size dummy argument of assumed-type.
CONTAINS
  SUBROUTINE sub(arg)
    TYPE(*) :: arg(3, 2:*)
  END
END

0 comments
0 views

Permalink