Array indexing and order differ between Fortran and C.
C arrays always start at zero, but by default Fortran arrays start at 1. There are two usual ways of approaching indexing.
You can use the Fortran default, as in the preceding example. Then the Fortran element B(2) is equivalent to the C element b[1].
You can specify that the Fortran array B starts at B(0) as follows:
INTEGER B(0:2)
This way, the Fortran element B(1) is equivalent to the C element b[1].
Fortran arrays are stored in column-major order: A(3,2)
A(1,1) A(2,1) A(3,1) A(1,2) A(2,2) A(3,2) A(1,3) A(2,3) A(3,3)
C arrays in row-major order: A[3][2]
A[0][0] A[0][1] A[0][2] A[1][0] A[1][1] A[1][2] A[2][0] A[2][1] A[2][2]
For one-dimensional arrays, this is no problem. For two-dimensional and higher arrays, be aware of how subscripts appear and are used in all references and declarations--some adjustments might be necessary.
For example, it may be confusing to do part of a matrix manipulation in C and the rest in Fortran. It might be preferable to pass an entire array to a routine in the other language and perform all the matrix manipulation in that routine to avoid doing part in C and part in Fortran.