s-news
[Top] [All Lists]

Debugging Fortran from S-PLUS [was Internal error (Splus 6.1 on Window

To: s-news@lists.biostat.wustl.edu
Subject: Debugging Fortran from S-PLUS [was Internal error (Splus 6.1 on Windows)]
From: "William Q. Meeker" <wqmeeker@iastate.edu>
Date: Thu, 24 Jun 2004 20:37:10 -0500 (CDT)
> > 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

Attachment: .FortranDebug.q
Description: Binary data

<Prev in Thread] Current Thread [Next in Thread>
  • Debugging Fortran from S-PLUS [was Internal error (Splus 6.1 on Windows)], William Q. Meeker <=