ok I ll look into how to put a more polished version of this
into the docs.


On Saturday, May 30, 2015 at 9:52:03 PM UTC-4, Jiahao Chen wrote:
>
> It would be great if you could clean up your example and add it to the 
> documentation.
>
> Thanks,
>
> Jiahao Chen
> Research Scientist
> MIT CSAIL
>
> On Sun, May 31, 2015 at 3:17 AM, Andre Bieler <[email protected] 
> <javascript:>> wrote:
>
>> 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