ALLOCATED() w/ user-defined ALLOCATABLE

ALLOCATED() w/ user-defined ALLOCATABLE

The following code returns an error when compiled:

--- module.f90 ---
MODULE MTest
TYPE CTest
INTEGER, ALLOCATABLE :: a(:)
END TYPE
END MODULE

--- main.f90 ---
PROGRAM MAIN
USE MTest
TYPE(CTest) :: t
IF (ALLOCATED(t%a)) STOP
END PROGRAM

The error returned is:
Error: The ARRAY argument of the ALLOCATED inquiry intrinsic function shall be an allocatable array. [ALLOCATED]

Interestingly, I can use the ALLOCATE() command successfully. Only the ALLOCATED() call fails.

If you declare the type within main.f90, it seems to work. It only fails with externally declared types.

Michael Carr

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

Send this example to vf-support@compaq.com Allocatable components of a derived type is a new feature and there are still some bugs.

Steve

Steve - Intel Developer Support

Lascia un commento

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