NRCan-IETS-CE-O-HBC / HTAP

NRCan's Ruby scripts for batch analysis and optimization with HOT2000
http://www.nrcan.gc.ca/energy/efficiency/housing/home-improvements/17725
GNU Lesser General Public License v3.0
14 stars 7 forks source link

Substitute-h2k.rb: Add ability to set run mode of input file #18

Closed jblake59 closed 6 years ago

jblake59 commented 6 years ago

HTAP currently allows user to specify the output data set to report on after a run but does not ensure that the H2K program mode coincides with the output set specified. Combine both of these capabilities in one option file entry.

jblake59 commented 6 years ago

There are currently only 2 run modes: General and ERS. However, the ERS run mode produces 7 different results sections. The current option "Opt-ResultHouseCode" allows for setting all of the required modes and can be supplemented with a special General mode when Brian Bradley provides us with a GenERS mode in version 11.5.

The current option provides all that is required for the input run mode to be changed in the model file.

jblake59 commented 6 years ago

Coding is complete and works for "General" and "NA" cases. When and ERS output mode is set (e.g., "SOC") the appropriate new XML section is added (i.e., Program section) and the generated file runs file in HOT2000 GUI but I keep getting a nil return value with the CLI version of HOT2000!

In fact, I haven't been able to successfully run any ERS mode file in the CLI version. This doesn't seem to have anything to do with the code I've added for this issue! I will push my code anyway.

jblake59 commented 6 years ago

Now working for ERS runs too. I though there may have been a problem with my creation of the "Program" XML section because I didn't fill in all of the tags (e.g., TSV section). But this wasn't the problem. Problem was two fold:

1) The file I was using was one of my making and referenced a weather library in a "funky" location that the CLI version of H2K did not find amusing!! It seems the CLI version wants the weather .dir file in the Dat folder "below" itself. 2) The weather path written into the configuration file HOT2000.ini by the substitute-h2k.rb script had an error that only seemed to cause a problem when run time was longer (aka ERS runs!).