ITA-Solar / rh

RH 1.5D
20 stars 17 forks source link

XRD #14

Open jaimedelacruz opened 7 years ago

jaimedelacruz commented 7 years ago

PRD runs with XRD subrogate lines can trigger a bug in the allocation of line->gII. Basically, that array is allocated in initial_p.c, but certain loops in scatter.c can go out of bounds because the loop limits are computed based on other XRD lines.

Perhaps the most elegant solution is to run once a similar loop as in scatter.c and check the array boundaries. Then store the maximum number of elements and always reallocate with that number of elements.