I did not build a test case for the result, but shouldn't the following
be enough?
module Copy_Overhead
implicit none
type box
real, dimension(:), pointer :: p
end type box
contains
subroutine print_box(a_box)
implicit none
type(box), intent(inout) :: a_box
real :: c_t(*)
pointer(c_p,c_t)
c_p=loc(a_box%p(1)) ! Assume it is contiguous
call print_a(c_t(1)) ! this does conform with the standard
end subroutine print_box
end module Copy_Overhead
As long as "c_p=loc(a_box%p(1)) works between a Fortran 90 pointer and a
Cray pointer, the rests are all good old FORTRAN plus the Cray pointer
extension. Maybe the compiler shouldn't know too much about print_a()
through an interface block. I don't see why you keep bringing the
interface block into this mess.
Well, I hope your compiler does not creat a temporary when it passes the
pointer a_box%p into "c_p=loc(a_box%p(1))". :-)
Your example remind me similar problems we tried to solve a couple of
years ago. A part of what I learned from them is that some problems go
away by themselves if one holds long enough not to solve them. :-)
Cheers,
Jing
--
________________________________ _-__-_-_ _-___---
Jing Guo, [log in to unmask], (301)614-6172(o), (301)614-6297(fx)
Data Assimilation Office, Code 910.3, NASA/GSFC, Greenbelt, MD 20771
|