ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/gen/loadEPW.c
(Generate patch)

Comparing ray/src/gen/loadEPW.c (file contents):
Revision 2.1 by greg, Wed Feb 26 20:39:28 2025 UTC vs.
Revision 2.2 by greg, Thu Feb 27 19:00:00 2025 UTC

# Line 149 | Line 149 | static int
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 */
# Line 160 | Line 160 | scan_date(EPWheader *epw)
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 */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines