Hi,
I am not an expert in programming but have some experience. It is more than a week that I am trying to read a data file from C into a Fortran program. C program saves a matrix in a bin format data file as follow:
FILE * amatFile;
amatFile = fopen("A.dat","wb");
for(krowa=0;krowa<N2;krowa++){
fwrite(amat[krowa], sizeof(float), S2, amatFile);
}
fclose(amatFile);
and my read section in F90 is:
open(unit=1,file='AMAT.dat',form='unformatted')
DO i = 1,M
Do j = 1,N
READ(unit=1) AMAT(i,j)
A(i,j) = AMAT(i,j)
End do
End Do
close(1)
I really appreciate if you can help me to solve the problem.