> > One way to test this is to write a Fortran main program passing the same
> > data to your subroutines and compile and run with bounds checking on.
> > (g77 --help -v will list the options, -ffortran-bounds-check is I think
> > what you need.)
I often use Brian Ripley's suggestion, given above.
After I got tired of all of the work that it entailed, I wrote the attached
function (.FortranDebug) that writes the needed files automatically. Just
change .Fortran to .FortranDebug and run the calling function. Files
ForDebugfort_code_file.f and ForDebugfort_data_file.txt will be written.
The resulting FORTRAN code is not pretty, but it is quick and effective for
debugging. I have used this approach many times on both Unix and Windows.
If your FORTRAN complier limits lines to 72 columns, you may need to edit
ForDebugfort_code_file.f before compiling.
William Q. Meeker
Department of Statistics
304C Snedecor Hall
Iowa State University
Ames, Iowa 50011
Phone: 515-294-5336
Fax: 515-294-4040
Home Fax: 515-232-1323
www.public.iastate.edu/~wqmeeker
.FortranDebug.q
Description: Binary data
|