Apologies for lack of posts over last few months have been doig other things:
I have been playing around with some array valued functions. I want these functions to be in a DLL. The length of the array should be varaible and not known until called.
I have got this working in WIN32 after som faffing. but when I target the .NET framework I get :
30: Storage heap is corrupt
the full exception is
exception this is thrown bSalford.Fortran.RuntimeException was unhandled Message='30: Storage heap is corrupt' Source='ftn95lib' StackTrace: at Salford.Fortran.RTLibrary.TempFree(Void* ptr) at Harness.HARNESS() in C:\Documents and Settings\ctipton\My Documents\Visual Studio 2005\Projects\FTN95Logit\Harness\Harness.F95:line 34
it appears to be the actual function itself which is the only funtion in the DLL.
function logit(costs, lambda)
assembly_interface(name='Logit')
real costs(:)
real lambda
real logit(size(costs))
logit= exp(-lambda*costs)/sum(exp(-lambda*costs))
end function
this is the calling code
program Harness
real cost(4)
real lambda
integer i
interface
function logit(costs,lambda)
real costs(:)
real lambda
real logit(size(costs))
end function
end interface
cost = 10
write (*,*) cost
lambda = 0.1
write(*,*) logit(cost,lambda)
call get_key@(i)
end program
This work fine in win32
is it something to do with .NET having arrays stored on the heap and I therefore need to use an allocate statement and a pointer of some sort?
I get the same error if I call the function from C#.
Carl