the type pointer error

the type pointer error

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?

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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

Leave a Comment

Please sign in to add a comment. Not a member? Join today