Hi, I have an error happened when I use exp() in my Fortran code. My Fortran code is
    SUBROUTINE f(n,c)
        
            REAL, INTENT(IN) :: n(10)
            REAL, INTENT(OUT) :: c(10)
            INTEGER :: k
        
            DO k=1, 10
               c(k) = exp( n(k) )
            END DO
END I compiled the fortran code as a dll Rcmd SHLIB -o f.dll f.f -L -lacml Then I loaded the dll file to R, and try some number
dyn.load("C:/Program Files/R/R-2.7.1/bin/code/f.dll")
.Fortran("f",as.real(c(1:10)),A=real(10))
[[1]]
[1] 1 2 3 4 5 6 7 8 9 10
$A
[1]  17066.21  58265.20 179948.41 390001.06 576529.12      0.00      0.00
[8] 0.00 0.00 0.00
I tried to figur out what happened, but confused. Any suggestion?
Thanks
Hao Ren

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to