Answers Re: Test your knowledge of simulation weather file formats Part 1: the DOE-2 *.BIN/*.BINM format

1 post / 0 new

I got a total of five responses,? all of which are attached at the end of this e-mail.?
Although I was focusing on the FORMAT of the *.BIN weather file, most of the respondents
focused on the data instead, and to my chagrin more intensely than I have, esp. Julien who
pointed out an anomaly in the direct normal radiation that made me gasp and go back into
my file and processing procedures.? Kudos to Julien for spotting that, but I'll explain
what happened there following his e-mail attached below.

The three answers I was seeking are:

(1) *The weather file is for a location above the Arctic Circle*, which would make
DOE-2.1E crash due to a bug in the shading calculation but not in DOE-2.2 which fixed this
bug in 2004.? The point here is that this is a problem in DOE-2.1E but NOT in the *.BIN
format, except it might seem that way because the DOE-2 weather packer also crashes
because it uses the same shading routine to generate the weather statistics.

(2) *The weather file is for a leap year with the output file showing Feb. 29th*.? I've
heard many people say that DOE-2 weather files contain only 365 days, but that's
absolutely not true.? The *.BIN format stores data for 12 months of 32 days each, or 384
days!? The reason that Feb. 29th never shows up in a DOE-2 run is that the developers
never bothered to reset the February day count to 29 on leap years, even though DOE-2
calculates when that's the case.? Now that more people are running DOE-2 with actual
historical years, it's well past time for this little fix to be implemented.

(3) *The weather file reports shows the weather parameters to an additional decimal of
precision*, i.e., temperatures are to the 0.1F, pressures to 0.01 inches of mercury, solar
radiation to 0.1 Btu/sqft, and wind speeds to 0.1 mph.? This required a modest change to
the BIN format that I implemented as the *.BINM (M for Modified) starting in 2011.? This
leads to what I think is the most fascinating part about the DOE-2 *.BIN format that was
developed in the early 1980's when computer memory was very limited. Members of the
original development team (Ender Erdem and maybe Fred Buhl) came up with the strategy of
"packing" the data by converting all data to integers, pack four integers into one big
integer, and then store them in the file in binary form. By so doing the *.BIN files are
only 146K (70-80KB zipped), whereas other formats can be well over 1MB (200+KB zipped).
DOE-2 also uses the *.BIN format to improve execution speed by not reading the data an
hour at a time or 8760 ASCII reads, but by reading 16 day chunks at a time or 24 binary
reads? for the entire year (which also explains why the *.BIN format contains 24x16 or 384
days).

So now let's look at how did our contestants do, listed in order of when I received their
answers:

Parag -? 0 out of 3? (he looked almost entirely on the data, not on the format)

Julien -? 1 out of 3 (he noticed the leap day, but also focused his attention on the data
and pointed out two problems that I will address following his e-mail? below)

Aaron - 2 out of 3 (I was impressed that he knew about the packing and unpacking process,
but did not notice the leap year)

Javed -? 0 out of 3 (but had a good question on why DNI (Direct Normal) is larger than GHI
(Global Horizontal) that I will answer following his e-mail below)

Nathan - 1 out of 3 (he also noticed the leap day, and had other questions that I will
answer following his e-mail below).

So, nobody noticed all three answers, but since it's the holiday season, I will make them
all winners and provide a historical year weather file of their choosing. Just e-mail me
if you're interested and tell me which one you want.

This has been an interesting and insightful experience for me. I hope others also found it
entertaining and useful, as well. I've learned that (1) think twice before coming out with
a flawed contest rule, (2) look over more times whatever I put out on the Web.

(please be sure to read the contestant's submittals and my responses below)

Joe

Joe Huang
White Box Technologies, Inc.
346 Rheem Blvd., Suite 205A
Moraga CA 94556
yjhuang at whiteboxtechnologies.com
http://weather.whiteboxtechnologies.com for simulation-ready weather data
(o) (925)388-0265
(c) (510)928-2683
"building energy simulations at your fingertips"

Attached e-mails? follow in the same order (only final e-mails shown)
-----------------------------------------------------------

Joe Huang's picture
Offline
Joined: 2011-09-30
Reputation: 406