Hello,
I cannot get a 3D array to work properly between c and fortran.
I put it in the fortran file (for.f90):
COMMON/ENVREAL/zwtemp(3,3,3)
so it should be global, then in the C file (c.c) it is:
extern struct {
double long zwtemp[3][3][3];
} envreal_;
yet when I try to assign a number to a position from the C file, say [1][1][1], it explodes all over my office. any ideas? I'm linking the two with the following commands:
gcc -c c.c
ifort -c for.f90
gcc -o out c.o for.o
I cannot get a 3D array to work properly between c and fortran.
I put it in the fortran file (for.f90):
COMMON/ENVREAL/zwtemp(3,3,3)
so it should be global, then in the C file (c.c) it is:
extern struct {
double long zwtemp[3][3][3];
} envreal_;
yet when I try to assign a number to a position from the C file, say [1][1][1], it explodes all over my office. any ideas? I'm linking the two with the following commands:
gcc -c c.c
ifort -c for.f90
gcc -o out c.o for.o