| 149 |
|
scan_date(EPWheader *epw) |
| 150 |
|
{ |
| 151 |
|
int hour; |
| 152 |
< |
float minute; |
| 152 |
> |
int minute; |
| 153 |
|
|
| 154 |
|
++epw->lino; |
| 155 |
|
if (epw->isWEA) { /* simpler for WEA input */ |
| 160 |
|
epw->dtpos.month--; |
| 161 |
|
} else { |
| 162 |
|
/* EPW input line */ |
| 163 |
< |
if (fscanf(epw->fp, "%hd,%hd,%hd,%d,%f,", &epw->dtpos.year, |
| 163 |
> |
if (fscanf(epw->fp, "%hd,%hd,%hd,%d,%d,", &epw->dtpos.year, |
| 164 |
|
&epw->dtpos.month, &epw->dtpos.day, &hour, &minute) != 5) |
| 165 |
|
goto scanerr; |
| 166 |
< |
epw->dtpos.hour = hour - minute*(0.5/60.); |
| 166 |
> |
epw->dtpos.hour = hour-1; |
| 167 |
> |
if (epw->period[0].nperhour == 1) |
| 168 |
> |
epw->dtpos.hour += .5; |
| 169 |
> |
else |
| 170 |
> |
epw->dtpos.hour += minute*(1./60.); |
| 171 |
|
epw->dtpos.month--; |
| 172 |
|
} |
| 173 |
|
/* check date/time */ |