There are two macros that deal with common blocks, F77_NAMED_COMMON and F77_BLANK_COMMON. They are used when declaring external structures that corresponds to FORTRAN common blocks and when referring to components of those structures in the C code. The following declares a common block named ``block'' that contains three INTEGER variables and three REAL variables.
extern struct { F77_INTEGER_TYPE i,j,k; F77_REAL_TYPE a,b,c; } F77_NAMED_COMMON(block);
The corresponding FORTRAN statements are
INTEGER I,J,K REAL A,B,C COMMON /BLOCK/ I,J,K,A,B,C
Within the C function the variables would be referred to as:
F77_NAMED_COMMON(block).i, F77_NAMED_COMMON(block).j, etc.
Note that all that these macros do is to hide the actual name of the external structure from the programmer. If a computer implemented the correspondence between FORTRAN common blocks and C global data in a completely different way, then these macros would not provide portability to such an environment.
On account of this, it is best to avoid using common blocks where possible, but of course, if you need to interface to existing FORTRAN programs, this may not be practical.
CNF and F77 Mixed Language Programming -- FORTRAN and C