Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29235 Discussions

Can't compile code that use a use a shared variable (User defined Type) from a module...

toreleraand
Beginner
500 Views
Hi,
When trying to compile a subroutine that access a common variable from a module, the compiler just returns :"Compilation Aborted" ...(code 3). WHat is special about the variable is that it is a user defined TYPE with internal arrays.(The compiler does not complain when compiling routines that accesses module-variablesthat are arrays of User Defined types.)
Compared to the CVF environment, is there something wrong with having arrays in a TYPE, ...is this treated differently with the Intel compiler? I have no other TYPE definitions with array variables inside. (Normally I have arrays of TYPES, not the other way around)
Tore
Here is the code-snippet from the module itself:
--------------------------------

TYPE TERR1D_STRUCTURE

SEQUENCE

REAL*8 KP(1:Nterr1Dmax)

REAL*8 Z(1:Nterr1Dmax)

REAL*8 Lat(1:Nterr1Dmax)

REAL*8 Lon(1:Nterr1Dmax)

Integer*4 N

Integer*4 Padding

END TYPE

...

...

COMMON /COM_TERR1D/ Terr1d

SAVE /COM_TERR1D/

!DEC$ ATTRIBUTES DLLEXPORT :: /COM_TERR1D/

!DEC$ ATTRIBUTES ALIAS:'/COM_TERR1D/' :: /COM_TERR1D/

TYPE(TERR1D_STRUCTURE) Terr1d !

...

------------------------------------------------------------------------

The module created from the above code is then used from a subroutine in a static library. The subroutine won't compile as long as I try to reference the arrays in the type, as illustrated below:

use moeTypes !...this is the module name

real*8 dummy

dummy=terr1D.KP(i)

---------------------------------------

0 Kudos
1 Reply
Steven_L_Intel1
Employee
500 Views
You encountered an internal compiler error. This is always a compiler bug. If it still happens with a current compiler, please report it to Intel Premier Support. If you don't want to do that but would like me to see if the problem still exists, e-mail me the sources to steve.lionel at intel.com
0 Kudos
Reply