Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

What causes divide by zero errors and how can they be debugged?

asked 2014-09-12 18:17:36 -0500

updated 2015-11-10 15:16:27 -0500

I've come across a strange error where two out of three nearly identical IDFs fail with an output like the one shown below. The only differences are in the size of water heater tank, the size of zones (it's a simple two-zone model), and the thermal properties of the walls (density and conductivity).

What sort of errors in a model produce divide by zero Fortran errors like this one, and how do I go about debugging my IDF?

Warming up {1}
forrtl: error (73): floating divide by zero

Image              PC                Routine            Line        Source             
EnergyPlus.exe     000000014077515B  waterthermaltanks        6654  PlantWaterThermalTank.f90
EnergyPlus.exe     0000000140773E30  waterthermaltanks        6398  PlantWaterThermalTank.f90
EnergyPlus.exe     000000014076D3E7  waterthermaltanks        8085  PlantWaterThermalTank.f90
EnergyPlus.exe     0000000140732069  waterthermaltanks         896  PlantWaterThermalTank.f90
EnergyPlus.exe     0000000140DEA4F4  plantloopequip_mp         673  PlantLoopEquipment.f90
EnergyPlus.exe     0000000140FCBA86  plantloopsolver_m        1270  PlantLoopSolver.f90
EnergyPlus.exe     0000000140FC4826  plantloopsolver_m         270  PlantLoopSolver.f90
EnergyPlus.exe     00000001410857D7  plantmanager_mp_m         184  PlantManager.f90
EnergyPlus.exe     00000001410B71BE  hvacmanager_mp_si        1792  HVACManager.f90
EnergyPlus.exe     00000001410AEF35  hvacmanager_mp_si         694  HVACManager.f90
EnergyPlus.exe     00000001410A2E49  hvacmanager_mp_ma         249  HVACManager.f90
EnergyPlus.exe     00000001410C1CD2  heatbalanceairman         123  HeatBalanceAirManager.f90
EnergyPlus.exe     000000014110FF52  heatbalancesurfac         149  HeatBalanceSurfaceManager.f90
EnergyPlus.exe     0000000141145CC0  heatbalancemanage         215  HeatBalanceManager.f90
EnergyPlus.exe     00000001411C4ED9  simulationmanager         376  SimulationManager.f90
EnergyPlus.exe     00000001411F0359  MAIN__                    421  EnergyPlus.f90
EnergyPlus.exe     00000001413BBA1C  Unknown               Unknown  Unknown
EnergyPlus.exe     000000014139941F  Unknown               Unknown  Unknown
kernel32.dll       00000000778959ED  Unknown               Unknown  Unknown
ntdll.dll          0000000077ACC541  Unknown               Unknown  Unknown
edit retag flag offensive close merge delete



Can you run the .eio file comparison as suggested and revise the question based on that?

Clayton Miller's avatar Clayton Miller  ( 2014-09-16 03:48:48 -0500 )edit

I managed to work around it by completely restructuring my IDF but I should be able to go back and find the breaking ones.

Jamie Bull's avatar Jamie Bull  ( 2014-09-17 02:12:17 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2014-10-21 09:37:26 -0500

Ideally, users should never see a divide-by-zero dump. The code should be programmed to protect against a zero denominator everywhere, but that is not always the case. Any idf file that crashes like this should be submitted to the helpdesk so the code can be fixed.

The causes could range from a bad user input (zero value or a value that results in, say, a zero deltaT somewhere), a zero sizing result as suggested by @Archmage, or a simulation condition that produces a zero value.

To diagnose the problem, the user should check the error output (.err) first. In many such cases, there may be an error message or warning that indicates a problem prior to the crash. The most direct way to debug this type of error is to look at the referenced line of source code. In this case "line 6654 PlantWaterThermalTank.f90". Even without looking at the source code, the source file name gives a clue, in this case that the problem is with a water heater or chilled water storage tank.

edit flag offensive delete link more

answered 2014-09-15 08:30:15 -0500

Archmage's avatar

The first thing to check is if there are any zero-valued size results being produced from autosizing. The EIO file will have a record of the sizing outcomes so check in there for zero values for capacity or volume. Run a file difference compare on two EIO files, one from a model that runs and one from a model that doesn't.

edit flag offensive delete link more


This text, while very helpful, should likely be a 'comment' to the question as it doesn't directly answer -- it only provides troubleshooting advice which the question asker can use to provide more information...

Clayton Miller's avatar Clayton Miller  ( 2014-09-16 03:48:20 -0500 )edit

seems to me that "how do I go about debugging my IDF?" is really asking for troubleshooting advice.

Archmage's avatar Archmage  ( 2014-09-16 09:19:20 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops


Question Tools

1 follower


Asked: 2014-09-12 18:17:36 -0500

Seen: 2,385 times

Last updated: Oct 21 '14