Ok so I have a few simple examples working for ccalling fortran functions 
and subroutines from Julia.
Maybe someone will find this useful examples when first looking into 
calling fortran from julia.

compile the following fortran mod
```
!fileName = simplemodule.f95
module simpleModule

implicit none

contains
function foo(x)
  integer :: foo, x
  foo = x * 2
end function foo

subroutine bar(x, a, b)
  integer, intent(in) :: x
  integer, intent(out) :: a, b
  
  a = x + 3
  b = x * 3
end subroutine bar

subroutine keg(x, a, b)
  real*8, intent(in) :: x
  real*8, intent(out) :: a, b
  
  a = x + 3.0
  b = x * 3.0
end subroutine keg

subroutine ruf(x, y)
  real*8, dimension(3), intent(in) :: x
  real*8, dimension(3), intent(out) :: y
  integer :: i
  
  DO i = 1, 3
    y(i) = 2*x(i)
  END DO
end subroutine ruf

end module simplemodule
```

Reply via email to