[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fortran error



Hi,

> floating-point error: divide by zero.

This error message is quite general and it's difficult to guess what
went wrong in your program. You'd better run a simple test step-by-step,
or use some debugger if you already have it handy. Since the Newton-Raphson
algorithm does involve division, that's the first place you need to check!

A few common mistakes I used to commit (since I'm more fluent in C): Fortran
implements multidimensional arrays differently than other languages. If
you're working with matrices, make sure that you initialize and use them
properly (Fortran stores a matrix column-by-column, *not* row-by-row like
C does). Also be careful with the calling sequences if you're using
subroutines written by others.

In case you get desperate, here is a pointer to some ready-to-run Fortran 
codes in the LAPACK package that you may find useful. They are well-written,
and standardized:

		http://www.netlib.org/bib/gams.html

Look under F (Solutions of Nonlinear Equations) and G (Optimization).

Good luck!

-Thanh