Software Archive
Read-only legacy content
17060 Discussions

Initializes a pointer

Intel_C_Intel
Employee
1,252 Views
Hi ?

I am a CVF 6.5A user on Intel NT 4.0.

I have a problem to initialize an array, declared as a pointer.

When I declare USE DFWINA, following errors are occurred.

But does not declare USE DFWINA, errors are cleaned.

Because of I should use many functions in DFWINA, above problems should be solved.

Help me please !

Thanks


*** Code ***
use dfwina
integer*4, pointer :: a(:) => null()

I = 10
if(not. associated(ia)) allocate(ia(n))

stop
end

*** Error ***
Compaq Visual Fortran Optimizing Compiler Version 6.5 (Update A)
Copyright 2001 Compaq Computer Corp. All rights reserved.

test.f90
test.f90(2) : Error: This array or function or substring is invalid in constant
expressions. [NULL]
integer*4, pointer :: ia(:) => null()
-------------------------------------^
test.f90(2) : Error: This is not a valid initialization expression. [NULL]
integer*4, pointer :: ia(:) => null()
-------------------------------------^
0 Kudos
1 Reply
Jugoslav_Dujic
Valued Contributor II
1,251 Views
Bingo! -- I had the same problem and just after I saw your post I realized
what is the problem: DFWIN(A) defines NULL as an INTEGER, PARAMETER.
To use NULL() intrinsic you have to rename DFWIN'S NULL to something else, e.g. NUL:

USE DFWINA, NUL=>NULL

Jugoslav
0 Kudos
Reply