MGFAS - f77


WLLRDQN
10-08-2005, 03:44 PM
In the NR textbook for f77 (Volume 1, 2nd ed.), the FORTRAN code for mgfas has multiple call statements to subroutine rstrct. Subroutine rstrct requires the 1st 2 arguments to be 2D matrices. However, the call statements do not always have matrices in the calling argument list. As a result, my FORTRAN 77 compilers stop, with errors. What am I missing?

Saul Teukolsky
10-09-2005, 08:56 AM
Hi,

The f77 standard definitely allows 1-d arrays to be passed as arguments to routines expecting matrix arguments. (For efficiency reasons, a lot of old f77 code was written this way.) Modern compilers sometimes attempt to be "helpful" by doing type-checking on f77 code. Your best bet is to try to find a compiler option that lets you turn this feature off. If all else fails, try the f90 version of mgfas.

Saul Teukolsky