Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
37 lines (29 sloc) 499 Bytes
title author date output
Test Fortran
John Nash
July 3, 2014
html_document

Run fortran subroutines

Does it work?

C Fortran test
      subroutine fexp(n, x)
      double precision x
C  output
      integer n, i
C  input value
      do 10 i=1,n
         x=dexp(dcos(dsin(dble(float(i)))))
  10  continue
      return
      end

Now try running it.

res = .Fortran("fexp", n = 100000L, x = 0)
str(res)
## List of 2
##  $ n: int 100000
##  $ x: num 2.72