[R] .Fortran and memory allocation
Gunnar Hellmund
ghellmund at gmail.com
Wed Dec 10 17:35:38 CET 2008
Hi
I know it is not recommended to use dup=FALSE with .Fortran calls, but ...
1)
Is it possible to allocate memory for a large array of type double or
integer without initializing the array
(and how is this done)
2)
If the answer to question 1) is 'Yes':
Is it possible to pass the uninitialized array to a subroutine in a
Fortran DLL (with dup=FALSE) including the dimensions (n1, ... , n3)
in the call and then initialize the array in Fortran:
subroutine arraycall(myarray,dimensions)
integer, intent(in) :: dimensions(3)
double precision :: myarray(dimensions(1),dimensions(2),dimensions(3))
myarray=0.0
end subroutine arraycall
best
Gunnar
More information about the R-help
mailing list