| 458 |  | double mean = sum / NSSAMP; | 
| 459 |  |  | 
| 460 |  | double intensity = mean * WVLSPAN; | 
| 461 | < | if (dirnorm > 0) { | 
| 461 | > | if (dirnorm >= 0) { | 
| 462 |  | intensity = dirnorm / SOLOMG / WHTEFFICACY; | 
| 463 |  | } | 
| 464 |  | double dir_ratio = 1.; | 
| 479 |  | float *pdest = parr + NSSAMP * near_patch[i]; | 
| 480 |  | int k; | 
| 481 |  | for (k = 0; k < NSSAMP; k++) { | 
| 482 | < | *pdest++ = sun_radiance[k] * wta[i] / wtot; | 
| 482 | > | *pdest++ += sun_radiance[k] * wta[i] / wtot; | 
| 483 |  | } | 
| 484 |  | } | 
| 485 |  | } | 
| 572 |  |  | 
| 573 |  | /* diffuse calibration factor */ | 
| 574 |  | double dif_ratio = 1; | 
| 575 | < | if (difhor > 0) { | 
| 575 | > | if (difhor >= 0) { | 
| 576 |  | DATARRAY *indirect_irradiance_clear = get_indirect_irradiance(irrad, radius, sun_ct); | 
| 577 |  | double overcast_ghi = overcast_zenithbr * 7.0 * PI / 9.0; | 
| 578 |  | double diffuse_irradiance = 0; | 
| 616 |  | int tstorage = 0;                                           /* number of allocated time steps */ | 
| 617 |  | int nstored = 0;                                            /* number of time steps in matrix */ | 
| 618 |  | int last_monthly = 0;                                       /* month of last report */ | 
| 619 | < | double dni;                                                 /* direct normal illuminance */ | 
| 620 | < | double dhi;                                                 /* diffuse horizontal illuminance */ | 
| 619 | > | double dni = -1.0;                                                 /* direct normal illuminance */ | 
| 620 | > | double dhi = -1.0;                                                 /* diffuse horizontal illuminance */ | 
| 621 |  |  | 
| 622 |  | float           *mtx_data = NULL; | 
| 623 |  | int mtx_offset = 0; |