updates to ST_grid.c and sxw.c for spinup version as well as fixing of memory errors/leaks