NREL/EnergyPlus — pull request #4623 by mjwitte (2014-12-11 05:16:23+00:00)
Title: Fix ShadowCalculation with TimestepFrequency hourly init in SolarShading

Fixes #4277
Original Fortran source
`SurfaceWindow%OutProjSLFracMult(HourOfDay) =1.0d0`
` SurfaceWindow%InOutProjSLFracMult(HourOfDay) =1.0d0`

The intent here (which I presume worked above) is to set OutProjSLFracMult(HourOfDay)=1.0 for all SurfaceWindow elements. Likewise for InOutProjSLFracMult.

The defective code
`SurfaceWindow.OutProjSLFracMult()( HourOfDay ) = 1.0;`
was apparently trying to access SurfaceWindow(HourOfDay), because it caused an array bounds assert failure when it reached HourOfDay=8 in a simulation with only 7 surfaces.

Initial attempt to fix was
`SurfaceWindow( { 1, TotSurfaces } ).OutProjSLFracMultHourOfDay( HourOfDay ) = 1.0;`
but that would not compile. @DeadParrot can you explain why this didn't work? Resorted to a for loop over all the surfaces.

@Myoldmopar @EnergyArchmage Can you explain why SurfaceWindow is allocated to TotSurfaces? It appears that this gives lots of unused elements for SurfNums that are not a window, but they all get initialized repeatedly, but I may be misunderstanding how SurfaceWindow gets used.