FPE problems in 12.5

Hi,

I recently started getting fpe warning messages such as:
Warning: ieee_underflow is signaling
Warning: ieee_inexact is signaling

It’s unclear to me why this is happening (I can’t seem to find the problem). When I turn on trapping (-Ktrap=inexact,unf), the code stops at lines which seem fine. A couple examples:

it2 = 1_IB
DO it=1,NT
DO ic=1,NCHAINT(it)
!  beta_pt(it2) = 1._RP/dTlog**REAL(it-1_IB,RP)
  obj(it2)%beta = beta_pt(it2)
  obj(it2)%cpt  = REAL(NCHAINT(it),RP)
  it2 = it2 + 1
ENDDO
ENDDO

If the commented line is uncommented, the code crashes.

Similarly, the following two lines crash the code.

  minlim = (/ hmin, 0.371_RP, LOG(2.e7_RP), 0.06_RP, LOG(4.53e-5_RP) /)
  maxlim = (/ hmx,  0.900_RP, LOG(8.e8_RP), 0.15_RP, LOG(0.049_RP) /)

When I remove the LOG from the above lines, the code gets past this but the crashes at another line which seems trivial.

The same code compiles fine under 10.1 and does not trigger any FPE warnings. Any ideas why this may be happening now?

Thanks, Jan

Hi Jan,

The same code compiles fine under 10.1 and does not trigger any FPE warnings. Any ideas why this may be happening now?

Thank the F2003 standard. The FPEs were probably occurring when built with 10.1 but are ignored by default. The F2003 standard requires the any FPE (even trival) be reported when a STOP statement is executed. Setting the environment flag “NO_STOP_MESSAGE” will revert to the old behavior of not printing these message.

Optimization will in many cases cause some degree of inexactness relative to IEEE 754. So your options here are to either ignore the warnings or to add the flag “-Kieee” to enforce IEEE 754 compliance. “-Kieee” can reduce performance since the optimizations that may effect precision will not be used and more precision but slower intrinsic routines will be used.

Note that our default optimizations do not stray more than 1 ulp of imprecision. Only if you use “-Mfprelaxed”, “-Mpfapprox”, or “-O4” do we go above 1 ulp. So if your problem is able to tolerate this degree of inaccuracy, then I would suggest ignoring the warnings.

Hope this helps,
Mat