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

the type pointer error

cepheid
Beginner
447 Views
for the type pointer code:

type ClusterNode
integer :: nes ! number of elements
type(IndexInCGNS),allocatable :: idxscg(:) ! indexes corresponding to cgns file (nes)
type(ClusterNode),pointer :: son1=>null() ! if HaveSons, allocate
type(ClusterNode),pointer :: son2=>null()
type(v3d) :: alpha, beta ! minimum
end type ClusterNode


1. when I use gfortran to compile, I got the error:
type(ClusterNode),pointer :: son1=>null() ! if HaveSons, allocate
1
Error: Cannot change attributes of USE-associated symbol null at (1)

2. when i use ifort to compile, I got the error:
This array or function or substring is invalid in constant expressions. [NULL]
type(ClusterNode),pointer :: son1=>null() ! if HaveSons, allocate
----------------------------------------^

3. when I use g95 to compile, it passed.


Could anyone tell me why?
0 Kudos
1 Reply
Ron_Green
Moderator
447 Views
there is not enough context to tell you anything. You did not say what versions of gfortran, ifort, and g95 you use,
and the code fragment is incomplete as the types v3d IntexInCGNS are not defined.

We need more information and code that can be compiled. I have a link below that explains how to upload a file.

ron
0 Kudos
Reply