Skip to content
Prev 51641 / 63424 Next

ALLOCATE in a FORTRAN subroutine

On 04/03/2016 3:34 AM, MAURICE Jean - externe wrote:
I don't think this is possible in pure Fortran, but it is certainly 
possible in C or C++ code.  You need to call the external routine using 
.Call() instead of .C or .Fortran.  See the section 5.9 of the Writing R 
Extensions manual for details.
No.  R needs to manage allocations of all the objects it uses.  However, 
if you never need to use these arrays in R code (you just want R to keep 
references to them to pass to other external routines), you can (in C or 
C++) use the external pointer type.  I don't think there's any support 
for that in Fortran.
No, for the same reason.

Duncan Murdoch