bmad-sim / bmad-ecosystem

Bmad simulation ecosystem for simulating high energy storage rings.
https://www.classe.cornell.edu/bmad/
7 stars 13 forks source link

segment fault from util_program/generalized_gradient_fit #1028

Closed jinhyukchoi closed 2 weeks ago

jinhyukchoi commented 2 weeks ago

I'm using the Intel Mac. Commenting-out line 457 of gg_fit_mod.f90 (zero_vec = 0) resolved the memory issue. It looks like, because zero_vec is assigned before it is allocated. I'm not sure the simple commenting-out can be the correct solution. Could you please check it? Thanks.

DavidSagan commented 2 weeks ago

@jinhyukchoi The fix was moving the set of zero_vec to after the allocation. The revised code has been put in the repo. Thanks for reporting this.