Closed AlejandroCN7 closed 2 years ago
@AlejandroCN7, thank you for reporting this. I succeeded in reproducing this bug, however it seems it goes against EnergyPlus fundamentals that "no order is needed in the input data file! Data that is not needed by a particular simulation is not processed." (From the Input/Output reference, section 1.1.1). I will try to figure out what is the best way to deal with it. A simple fix would be to remove the alphabetical ordering indeed, but there may be a better way to fix it.
@geoffroy-destaintot is there any reason why we sort objects when saving the Epm? Besides comparing two models?
@AlejandroCN7 I had the time to dig into this issue, and actually the order matter in the IDF for EnergyManagementSystem:ProgramCallingManager
. While the order can be specified within this object by referencing multiple programs in the right order under the right calling point - which would make the IDF robust to change in object order - I think it is reasonable to remove the alphabetical ordering when saving the Epm
for these objects specifically, so the order is preserved (whether it is the order from loading the model or for adding the objects into the Epm
directly using opyplus).
@geoffroy-destaintot More generally, we may want to emphasise that the most robust way of specifying order in calling the different EMS programs is within the same EnergyManagementSystem:ProgramCallingManager
, for each calling point. This way it is easier to modify an existing model.
Describe the bug If I save an IDF with opyplus, it saves the records and tables in alphabetical order, which causes the subsequent simulation with energyplus to generate an error.
To Reproduce Steps to reproduce the behavior:
energyplus -w USA_WA_Port.Angeles-William.R.Fairchild.Intl.AP.727885_TMY3.epw ASHRAE9012016_Warehouse_Denver.idf
. You can check that it works.building = Epm.from_idf( 'ASHRAE9012016_Warehouse_Denver.idf', check_length=False)
building.save('saved.idf')
Severe Problem found in EMS EnergyPlus Runtime Language. ~~~ Erl program name: PSZ_FINE_SET_FAN_PAR ~~~ Erl program line number: 1 ~~~ Erl program line text: IF PSZ_FINE_NUMBER_OF_STAGES == 1 ~~~ Error message: Error: EvaluateExpression: Variable = 'PSZ_FINE_NUMBER_OF_STAGES' used in expression has not been initialized! ~~~ During Warmup, Environment=WILLIAM R FAIRCHILD ANN CLG .4% CONDNS DB=>MWB, at Simulation time=01/01 24:00 - 24:15 Fatal Previous EMS error caused program termination.