Made sizes of arrays for packing in fortran explicit, put in print statement which seems to somehow fix crash in old versions of gfortran