If you are getting a runtime access violation, it probably depends on how you actually have coded SAMPLE_ROUTINE (how did you declare the dummy argument). Can you include that code? Also, include the actual interfaces you’ve tried.
You code is illegal. When you pass in “A(:,:)” you are passing in an array section which will loose it’s pointer property.
When compiling with PGI 15.5, you’ll get a syntax error:
% pgfortran -V15.5 testptr.f90
PGF90-S-0188-Argument number 1 (non-POINTER) to routine: type mismatch (testptr.f90: 15)
0 inform, 0 warnings, 1 severes, 0 fatal for test
In the F2008 standard this limitation was loosened a bit where target arrays can be passed in. From 12.5.2.7 Pointer dummy variables of the F2008 standard:
If the dummy argument does not have the INTENT (IN), the actual argument shall be a pointer. Otherwise, the
actual argument shall be a pointer or a valid target for the dummy pointer in a pointer assignment statement. If
the actual argument is not a pointer, the dummy pointer becomes pointer associated with the actual argument.
Of course with regard to “valid target”, this is from the specification as well:
5.3.17 TARGET attribute
The TARGET attribute specifes that a data object may have a pointer associated with it (7.2.2). An object
without the TARGET attribute shall not have a pointer associated with it.
Although A is an array, A(:, : ) is an array section, but it does not have the target nor pointer attribute.
So the problem looks like that when we added this new F2008 support in the 15.7, we lost emitting the syntax error. I added TPR#22290 requesting that the error message be added back in this case.