Opened 7 years ago

Closed 5 years ago

#193 closed defect - FPE (fixed)

abrupt underflow causes grid_extreme to fail

Reported by: Gary J. Ferland Owned by: nobody
Priority: major Milestone: C13 branch
Component: ionization convergence Version: trunk
Keywords: Cc:

Description

grid_extreme aborts with the atomic hydrogen density underflowing to zero when compiled with gradual underflow disabled. The sim runs ok with our default make with gcc which uses gradual underflow. Portland group disables gradual underflow by default so this will fail.

The attached bug.in will fail very quickly with abrupt underflow. The problem is that the atomic hydrogen density underflows to zero at cont_setintensity.cpp:893.

the situation was improved a bit with r4509 which uses the mean photon energy to get a better estimate of the H ionization rate. The H0 density is a bit over 1e-40 cm-3 with this change, so it still underflows.

Gradual underflow with our default make kept the H0 density > 0 but at the cost of decreased precision.

one fix would be to promote xIonDense to double. Any reason not to?

another would be to have the code abort if the H0 density is less than SMALLFLOAT - gradual underflow does buy extra dynamic range but at the expense of decreased accuracy. it may be dangerous.

Attachments (1)

bug.in (1.3 KB) - added by Gary J. Ferland 7 years ago.

Download all attachments as: .zip

Change History (3)

Changed 7 years ago by Gary J. Ferland

Attachment: bug.in added

comment:1 Changed 7 years ago by Gary J. Ferland

Component: etcionization convergence
Milestone: C12 branch

comment:2 Changed 5 years ago by Ryan Porter

Resolution: fixed
Status: newclosed

Works fine at r6340 with both sys_pgcc and sys_pgccBounds builds. And grid_extreme has been regularly passing sys_pgccBounds for a few months. The variables dense.xIonDense[] were promoted to doubles around the same time. That may or may not be the reason, but the problem is gone. Closing.

Note: See TracTickets for help on using tickets.