[R] Trouble returning 2D array into R from Fortran

paulfjbrowne paulfj.browne at gmail.com
Sat Oct 20 19:18:46 CEST 2012


I will look into using inline, but since the Fortran code is several thousand
lines long & is comprised of multiple subroutines, compiling it into a
shared object & dynamically loading it into R is probably the easier
solution.

I have also noticed a strange numerical problem when calling the routine
from within R as opposed to in its native Fortran. For example, for the same
set of input parameters, R will output;

(0.0315031507927081, 0.220339391742628)

Whereas the Fortran code internally outputs;

(0.0350479965640488472,  0.22220883087569138)

All variables are defined in the Fortran code as double, and are passed in
as double in the .Fortran call in R. I am a bit puzzled at the discrepancy
between the two calls' output.



--
View this message in context: http://r.789695.n4.nabble.com/Trouble-returning-2D-array-into-R-from-Fortran-tp4646862p4646874.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list