Re: Problems with an apparent compiler-senstive model
From: Leonid Gibiansky leonidg@metrumrg.com
Subject: Re: [NMusers] Problems with an apparent compiler-senstive model
Date: Sun, 30 Jul 2006 16:18:33 -0400
Max,
Floating point error message should be cured somehow. Two most often reasons are huge values in the
exponents and divisions by zero. In the code, there should be a defense against each of these causes
(if you face the problem). For example, if you have
error ~ 1/F then
do something like
IPRED=F
IF(F.LT.0.0001) IPRED=0.0001
error ~ 1/IPRED
This is just an example but often it helps to look on each division and make sure that the denominator
cannot be negative. Same things with the power operator: only positive values should be exponentiated.
Even zero in some power can give an error because of rounding error (when zero is interpreted as very
small negative number).
Another common reason is expression like
CL=TCL*EXP(ETA(1))
When ETA(1) is huge, it can result in error. You can use
MYETA=ETA(1)
IF(ETA(1).GT.20) MYETA=20
CL=TCL*EXP(MYETA)
or
IF(ETA(1).GT.20) EXIT
CL=TCL*EXP(ETA(1))
I would try to check the code with the idea to identify places where exactly floating point error
can be observed.
Leonid