INTERFACE SUBROUTINE DoSomething(dArray) !DEC$ATTRIBUTES C, ALIAS: '_dosomething':: DoSomething !DEC$ATTRIBUTES VALUE:: dArray INTEGER:: dArray END SUBROUTINE END INTERFACE
Enables a corresponding dummy argument to pass a NULL pointer (defined by a zero or the NULL intrinsic) by value for the argument. ALLOW_NULL is only valid if the REFERENCE property is also specified; otherwise, it has no effect.
Now the problem... I tried using this as the following:
INTERFACE FUNCTION DOIT(A) COMPLEX(8) :: A(:,:) !DEC$ ATTRIBUTES ALLOW_NULL, REFERENCE :: A END FUNCTION END INTERFACE
From the program I try to call it like this:
COMPLEX(8), ALLOCATABLE :: A(:,:) ... CALL DOIT(A)
This looks like it should work, but when I compile I get this error:
"Error: The shape matching rules of actual arguments and dummy arguments have been violated."
Now, it should seem that the ALLOW_NULL would let me give it EITHER an array or a NULL pointer... does it want me to send it an array of NULL pointers? :)
Thanks for your help!