removed a lot of slow FFT grid sizes from calc_grid and made calcgrid.c thread safe