Hi,
I got the following C# function
float[,] c = {{1.0f,2.0f},{3.0f,4.0f},{5.0f,6.0f}}; // Reshuffling to ftn indexing float[,] buf = FtnUtilities.ToFortran(c); int i=3, j=2; FromDotNet(buf, i, j);
The FromDotNet is a fortran assembly interface as declared below Subroutine FromDotNet(Buf2D, IN, JN) IMPLICIT NONE ASSEMBLY_INTERFACE(Name='FromDotNet') INTEGER IN, JN REAL(Kind=1) Buf2D(:,:)
Call FtnSub(Buf2D, IN, JN)
End Subroutine FromDotNet
Subroutine FtnSub (Buf2D, IN, JN)
IMPLICIT NONE
INTEGER IN, JN
REAL(Kind=1) Buf2D(IN,JN)
End Subroutine FtnSub
When the buffer received by the fortran assembly interface function is passed to the fortran function, the following exception is thrown: ''Salford.Fortran.RuntimeException' occurred in ftn95lib.mdl Additional information: 19: Argument one is too small for its declared size'. Is it possible to pass a C# array to a fortran assembly interface and then passing the same array further on to a fortran subroutine? If so, how should the 2 dimensional array be declared in the ftn assembly interface and in the fortran subroutine to make this possible?