Hello all,
In the EPW data dictionary documentation (http://bigladdersoftware.com/
epx/docs/8-3/auxiliary-programs/energyplus-weather-file-epw-
data-dictionary.html), I see the following:
···
================================================
DATA PERIODS,
N1, \field Number Number of Data Periods
N2, \field Number of Records per hour
...
A weather file may contain several “data periods” though this is not
required (and, in fact, may be detrimental). In addition, *a weather file
may contain multiple records per hour* BUT these must match the Number of
Time Steps In Hour for the simulation.
================================================
If I look at the program that converts EPW files to WEA files (
http://www.radiance-online.org/cgi-bin/viewcvs.cgi/ray/src/cv/epw2wea.c),
It seems to make use of the 'Records per hour' field. I see that the code
has a 'minute' variable that it initialises to 60, and it also has the
following chunk of logic that manipulates the minute variable:
fprintf(WEA_FILE,"site_elevation %s\nweather_data_file_units 1\n",elevation);
fscanf(EPW_FILE,"%*[^\n]");fscanf(EPW_FILE,"%*[\n\r]");
fscanf(EPW_FILE,"%*[^\n]");fscanf(EPW_FILE,"%*[\n\r]");
fscanf(EPW_FILE,"%*[^\n]");fscanf(EPW_FILE,"%*[\n\r]");
fscanf(EPW_FILE,"%*[^\n]");fscanf(EPW_FILE,"%*[\n\r]");
fscanf(EPW_FILE,"%*[^\n]");fscanf(EPW_FILE,"%*[\n\r]");
fscanf(EPW_FILE,"%*[^\n]");fscanf(EPW_FILE,"%*[\n\r]");
fscanf(EPW_FILE,"%*[^\n]");fscanf(EPW_FILE,"%*[\n\r]");
/* read in time step interval */
fscanf(EPW_FILE,"%[^,]s",keyword);
fscanf(EPW_FILE,",%[^,]s",keyword);
fscanf(EPW_FILE,",%[^,]s",minute_string);
minute=atoi(minute_string);
if(minute==1) /* one measurement per hour equals a 60 minute time step */
minute=60;
fscanf(EPW_FILE,"%*[^\n]");fscanf(EPW_FILE,"%*[\n\r]");
while( EOF != fscanf(EPW_FILE,"%d,%d,%d,%d",&year,&month,&day, &hour_in)){
fprintf(WEA_FILE,"%d %d %.3f ",month,day,hour_in*1.0-minute*(0.5/60));
If we look at a sample EPW file, e.g. https://energyplus.net/we
ather-location/north_and_central_america_wmo_region_4/USA/
NY/USA_NY_New.York-LaGuardia.AP.725030_TMY3,
================================================
LOCATION,New York Central Prk Obs Belv,NY,USA,TMY3,725033,40.78,
-73.97,-5.0,40.0
DESIGN CONDITIONS,0
TYPICAL/EXTREME PERIODS,6,Summer - Week Nearest Max Temperature For
Period,Extreme,7/17,7/23,Summer - Week Nearest Average Temperature For
Period,Typical,6/ 5,6/11,Winter - Week Nearest Min Temperature For
Period,Extreme,1/18,1/24,Winter - Week Nearest Average Temperature For
Period,Typical,11/22,11/28,Autumn - Week Nearest Average Temperature For
Period,Typical,9/26,10/ 2,Spring - Week Nearest Average Temperature For
Period,Typical,3/29,4/ 4
GROUND TEMPERATURES,3,.5,1.45,0.37,2.28,5.28,13.13,19.19,23.27,
24.51,22.40,17.69,11.41,5.58,2,5.43,3.50,3.89,5.49,10.
74,15.48,19.28,21.32,20.88,18.22,13.89,9.30,4,8.72,6.74,
6.31,6.91,9.88,13.08,16.01,18.05,18.53,17.37,14.83,11.72
HOLIDAYS/DAYLIGHT SAVINGS,No,0,0,0
COMMENTS 1,Custom/User Format – WMO#725033; NREL TMY Data Set (2008);
Period of Record 1973-2005 (Generally)
COMMENTS 2, – Ground temps produced with a standard soil diffusivity of
2.3225760E-03 {m**2/day}
DATA PERIODS,1,1,Data,Sunday, 1/ 1,12/31
1976,1,1,1,0,?9?9?9?9E0?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9*9*9*9*
9*9,2.2,-1.1,79,100400,0,0,295,0,0,0,0,0,0,0,40,9.3,10,10,
14.5,1070,9,999999999,100,0.0840,0,88,999.000,999.0,99.0
…
then it seems to me that the chunk of logic is targeted at the 'Records per
hour' field. When execution reaches the logic chunk, the program has just
finished processing line 1 of the data,
LOCATION,New York Central Prk Obs Belv,NY,USA,TMY3,725033,40.78,
-73.97,-5.0,40.0
so it skips seven lines and gets to the following:
DATA PERIODS,1,1,Data,Sunday, 1/ 1,12/31
It then skips 'DATA PERIODS' and the first '1' and reads the second '1'
into the minute variable. It then looks at the value in the minute
variable, and if it is one, it overwrites that value with 60.
(Why overwrite in with 60 if it was already initialised to 60?)
I then goes into a loop in which it repeatedly
* reads in year, month, day and hour_in
* writes out to the WEA file the month, day and hour_in, but in doing so,
it adjusts hour_in based on the content of the minute variable:
hour_in*1.0-minute*(0.5/60).
It looks like it is adjusting say 9 (9AM) to 8.30 when minute=60 and
leaving 9 alone when minute=0.
Can someone please explain why the code is doing that?
Why does it set the value of the minute variable if the 'Records per hour'
field is 1, but not if it is other values? What other values can it be? 0,
2, 3, 15, 30, 60, other?
Thank you in advance for your help,
Philip Schwarz