chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Re: Strange observation: Chicken, C, C++: Joe Averag


From: felix winkelmann
Subject: Re: [Chicken-users] Re: Strange observation: Chicken, C, C++: Joe Average does benchmarking
Date: Wed, 19 Dec 2007 13:52:12 +0100

On Dec 19, 2007 1:26 PM, Siegfried Gonzi <address@hidden> wrote:
>
> Question: why does'nt Chicken have fl*,fl+? I get a segementation fault. I 
> guess Chicken only implements fx*,fx+,... I cannot find it in the manual.
>
> Would'nt it make more sense to implement fl*,... too?

See:

http://chicken.wiki.br/Unit%20library#arithmetic-floating-point-operations

> What is the preferred method in Chicken: writing a wrapper function in C to 
> Fortran and in turn calling that particular wrapper function from Chicken?
>
> Btw: any serious C programmer here who can point me to a tutorial or method 
> how to accomplish the following lets now say from within C:
>
> given a Fortran subroutine:
>
> ==
> subroutine read(array,array_out,dim1,dim2,dim3)
>
> real*8, allocatable(:,:), intent(in) :: array
> real*8, allocatable(:,:), intent(inout) :: array_out
> integer, intent(inout) :: dim1,dim2,dim3
> end subroutine read
> ==
>
> The important thing here in Fortran 90: I pass an array which is allocated 
> inside the function.
>
> How could I write a wrapper function in C without knowing the returned array 
> dimension in advance. What could additionally be returned are the dimension 
> though and the allocated (with content) array from the Fortran subroutine. 
> Can I set a pointer in C to the returned (Fortran 90) array and with the 
> additional information of dimension dim1,dim2,dim3 the C pointer collects the 
> content of the array (Fortraner told me arrays in Fortran are always stored 
> consecutively in memory).
>

Sorry, someone more experienced with Fortran has to answer that.


cheers,
felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]