Should the dummy argument of an ELEMENTAL procedure be allowed to have an ALLOCATABLE attribute ?

Should the dummy argument of an ELEMENTAL procedure be allowed to have an ALLOCATABLE attribute ?

Dear Steve et al. at Intel,

The code listed below compiles with no errors or warnings using Intel Fortran compiler version 13.1.0.149 even if Fortran 2003/2008 standards checking is turned on.  This seems to be a violation of C1277 of Fortran 2003 standard that says:

 
8 12.7 Elemental procedures
 
9 12.7.1 Elemental procedure declaration and interface
 
10 An elemental procedure is an elemental intrinsic procedure or a procedure that is defined by an
11 elemental subprogram.
 
12 An elemental subprogram has the prefix-spec ELEMENTAL. An elemental subprogram is a pure sub
13 program. The PURE prefix-spec need not appear; it is implied by the ELEMENTAL prefix-spec. The
14 following additional constraints apply to elemental subprograms.
 
15 C1277 All dummy arguments of an elemental procedure shall be scalar dummy data objects and shall
16 not have the POINTER or ALLOCATABLE attribute.
 
17 C1278 The result variable of an elemental function shall be scalar and shall not have the POINTER or ALLOCATABLE attribute.
 

 

Can you please review and follow-up as you think is appropriate?  Perhaps it has been fixed in compiler 14, the latest update?

   MODULE foo
 
      TYPE t
      END TYPE t
 
   CONTAINS
 
      PURE ELEMENTAL SUBROUTINE foo1(x)
 
         TYPE(t), ALLOCATABLE, INTENT(INOUT) :: x
 
      END SUBROUTINE foo1
 
      PURE ELEMENTAL SUBROUTINE foo2(x)
 
         TYPE(t), ALLOCATABLE, INTENT(OUT) :: x
 
      END SUBROUTINE foo2
 
      PURE ELEMENTAL SUBROUTINE foo3(x)
 
         TYPE(t), ALLOCATABLE, INTENT(IN) :: x
 
      END SUBROUTINE foo3
 
   END MODULE foo
 

 

10 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

Note Intel Fortran compiler version 13.1.0.149 correctly throws an error if the dummy argument attribute is POINTER instead of ALLOCATABLE.

In your case, the allocatable object is a scalar (one of your type t).

Line 17 C1278 The result variable of an elemental function shall be scalar and shall not have the POINTER or ALLOCATABLE attribute.

Your program is using elemental subroutine.

Jim Dempsey

www.quickthreadprogramming.com

Jim,

You're referring to item C1278 starting on line 17 that refers to the result variable of an ELEMENTAL function.

Instead it is item C1277 starting on line 15 that applies to my code example.  Note it says:

15 C1277 All dummy arguments of an elemental procedure shall be scalar dummy data objects and shall
14
16 not have the POINTER or ALLOCATABLE attribute.

Thanks for bringing this to our attention. My guess is that it was missed a long time ago when we added allocatable dummy arguments. I will let the developers know.

Steve - Intel Developer Support

It turns out that this was reported a little while ago and is on the list to be fixed. Issue ID is DPD200247686.

Steve - Intel Developer Support

Steve,

Thanks much for following up on this.  Any word on the timing for the fix?

 

No word. It won't be before the next major release later this year.

Steve - Intel Developer Support

This has been fixed for 15.0 Update 2, available now from the Intel Registration Center.

Steve - Intel Developer Support

Awesome, thank you.

Lascia un commento

Eseguire l'accesso per aggiungere un commento. Non siete membri? Iscriviti oggi