Julien,
I think we should take this offline as it's getting into the
weeds.
Joe
Joe Huang
White Box Technologies, Inc.
346 Rheem Blvd., Suite 205A
Moraga CA 94556
yjhuang@xxxxxxxxxxxxxxxxxxxxxxxx
http://weather.whiteboxtechnologies.com for simulation-ready weather data
(o) (925)388-0265
(c) (510)928-2683
"building energy simulations at your fingertips"
Joe,
Thanks for sharing these. The other day I went
looking for the MKAFT and PKAFT, but realized
I could only find them as a windows exe so I
gave up on this (I could have installed them
on linux using WineHQ but I didn't care
enough).
I was able to quickly compile these as a
Unix exe using gfortan, and I can at least run
them.
I tried out of the curiosity to see how I could
port this to python, but this isn't going to
happen for me (at least not without someone
explaining very simply what the code does): I
generally dislike Fortan syntax very much so
I never got into it, and while I can generally
follow scientific fortran about fine, the I/O
stuff is really incomprehensible to me.
So far I was just able to figure out how to
unpack the IWID and IWYR, after 30 minutes of
scratcthing my head, the rest I get numbers but
they don't match (I'm trying to read 4 bytes as
an int for WLAT, WLONG, etc)
I also have never really dealt with packed
binary files (seems to me like it's completely
unnecessary nowadays that we have gigabytes of
RAM and plently of disk space). At least I
learned some new vocabulary, such as Hollerith
strings (which I found out later, the fortran
compiler itself told me it's deprecated)
I don't understand this in wthfm2Mleapyr.f:
DO 100 IM1=1,12
READ (10)
(IWDID(I),I=1,5),IWYR,WLAT,WLONG,IWTZN,LRECX,NUMDAY,
_ CLN(IM1),GT(IM1),IWSOL
READ (10) IDUM
100 CONTINUE
Is the format expected in the binary file 20 chars
followed by 6 integers
(IWYR,WLAT,WLONG,IWTZN,LRECX,NUMDAY,) + 12 integers
(CLN) + 12 integers (GT) + 1 integer (IWSOL) + 1
integer (IDUM)?
I've tried this in python:
import struct
with open('AK_BARROW-W-POST-W-ROGERS-AP_700260_12.BINM',
'rb') as f:
bindata = f.read()
fmt = '20s6i12i12iii'
start_pos = 4 # Apparently I have to skip the first 4
bytes.
end_pos = start_pos + struct.calcsize(fmt)
struct.unpack(fmt, bindata[start_pos:end_pos])
Which give me this, and it doesn't seem to match the
WEATHER.FMTM file generated by the fortran utility:
(b'BARROW-W-POST700260 ',
2012,
1116639068,
1125960909,
9,
1,
31,
1063675494,
1139180158,
5,
9849418,
328,
200,
98569,
9849418,
583,
200,
98567,
9915211,
648,
327,
100618,
9850960,
648,
326,
106761,
9851217,
9,
326,
106764,
9851475,
649,
454)
__._,_.___
Posted by: Joe Huang <yjhuang@xxxxxxxxxxxxxxxxxxxxxxxx>
EnergyPlus support is found at:
http://energyplus.helpserve.com or send a message to energyplus-support@xxxxxxxx
The EnergyPlus web site is found at:
http://www.energyplus.net/
The group web site is:
http://groups.yahoo.com/group/EnergyPlus_Support/
Attachments are currently allowed but be mindful that not everyone has a high speed connection. Limit attachments to small files.
EnergyPlus Documentation is searchable. Open EPlusMainMenu.pdf under the Documentation link and press the "search" button.
__,_._,___
|